Stephan Miller

05 Nov, 2007

Tag Support for the Onlywire Autosubmit Plugin

Posted by: User ImageStephan Miller In: Programming| Wordpress

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

This will be the first time I ventured into editing a plugin. It is hard to find information on tag support for Wordpress 2.3. This post will tell me if I found everything I needed to make this plugin work a little better. The original onlywire autosubmit plugin can be found here.

After using it a few times and then checking my delicious account, I realized the tagging functioning of this plugin didn’t work. Then I opened up the plugin and it didn’t even add tags. It just bookmarked your post without any tags to identify it. So I did some research and think I added the correct lines of code.

First I have to work around the exec-php plugin to post the code here. I fit in it as good as I could.

Wait until I update this post to see if it worked.

 

<?php
/**
Plugin Name: Only Wire Autosubmitter
Plugin URI: http:www.lionstarr.de/onlywire-autosubmitter-wordpress-plugin
Version: 2.0
Description: Autosubmits a excerpt of a posts to Onlywire when published
Author: lionstarr
Author URI: http:www.lionstarr.de
*/
/* Copyright 2007 lionstarr (email : lionstarr@googlemail.com)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

function onlywireSubmit($post_ID){
$username=get_option(’onlywire_username’);
$password=get_option(’onlywire_password’);
$post=get_post($post_ID);
$permalink = get_permalink($post_ID);
if ($posttags) {
$tags = get_the_tags($post_ID);
foreach($tags as $tag) {
$taglist .= $tag->name." ";
}
}
$url="http://$username:$password@www.onlywire.com/api/add?
url=".$permalink."&title=".urlencode($post->post_title)."&tags=".$taglist;
$returncode = file_get_contents($url);
update_option(’onlywire_returncode’,$returncode);
update_option(’onlywire_perm’,$permalink);
update_option(’onlywire_title’,$post->post_title);
update_option(’onlywire_url’,$url);
return $post_ID;
}
add_action(’publish_post’, ‘onlywireSubmit’);

// mt_add_pages() is the sink function for the ‘admin_menu’ hook
function mt_add_pages_onlywire() {
// Add a new menu under Options:
add_options_page(’OnlyWire Options’, ‘OnlyWire Options’, 8, ‘onlywireoptions’, ‘mt_options_page_onlywire’);
}

// mt_options_page() displays the page content for the Test Options submenu
function mt_options_page_onlywire() {
if($_POST['onlywire_save']){
update_option(’onlywire_username’,$_POST['onlywire_username']);
update_option(’onlywire_password’,$_POST['onlywire_password']);
echo ‘<div class="updated"><p>OnlyWire Username ‘.$_POST['onlywire_username'].’ and his password were sucessfully saved!</p></div>’;
}
if($_POST['onlywire_reward'] && get_option(’onlywire_rewarded’)!="true"){

$username=get_option(’onlywire_username’);
$password=get_option(’onlywire_password’);
$url="http://$username:$password@www.onlywire.com/api/add?
url=http://www.lionstarr.de&title=Linux%20Tutorials";
$url2="http://$username:$password@www.onlywire.com/api/add?
url=http://www.lionstarr.de/onlywire-autosubmit-a-wordpress-plugin.html&title=".urlencode("OnlyWire Autosubmit A Wordpress Plugin");

$ret1=file_get_contents($url);
$ret2=file_get_contents($url2);
if($ret1=="<?xml version=\"1.0\" encoding=\"utf-8\"?><result code=\"success\" />" && $ret2=="<?xml version=\"1.0\" encoding=\"utf-8\"?><result code=\"success\" />"){
echo ‘<div class="updated"><p>Thanks for rewarding the author!</p></div>’;
update_option(’onlywire_rewarded’,'true’);
}
else{
echo ‘<div class="updated"><p>It didn\’t work! Please try again another time!</p></div>’;
}
update_option(’onlywire_returncode’,$ret2);
update_option(’onlywire_perm’,"http://www.lionstarr.de/onlywire-autosubmit-a-wordpress-plugin.html");
update_option(’onlywire_title’,"OnlyWire Autosubmit A Wordpress Plugin");
update_option(’onlywire_url’,$url2);
}
?>
<div class="wrap">
<h2>OnlyWire Autosubmit Options</h2>
<form method="post" id="onlywire_options">
<fieldset class="options">
<legend>OnlyWire Authentifcation</legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row">OnlyWire Username:</th>
<td><input name="onlywire_username" type="text" id="onlywire_username" value="<?php echo get_option(’onlywire_username’) ;?>"/>
</td>
</tr>
<tr valign="top">
<th width="33%" scope="row">OnlyWire Password:</th>
<td><input name="onlywire_password" type="password" id="onlywire_username" value="<?php echo get_option(’onlywire_password’) ;?>"/>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="onlywire_save" value="Save" /></p>
</fieldset></form>
<b>If you’d like to reward the author of this plugin, please press the Reward Author button once. It will submit the Author’s Sites to OnlyWire using your Username. If the button doesn’t show up, you have already rewarded the author.</b>
<?php if(get_option(’onlywire_rewarded’)!="true"){ ?>
<form method="post" id="onlywire_reward_author">
<p class="submit"><input type="submit" name="onlywire_reward" value="Reward the Author of this Plugin" /></p><?php } ?>
</form>
<p>The last Item submitted to OnlyWire was <a href="<?php echo get_option(’onlywire_perm’); ?>"><?php echo get_option(’onlywire_title’); ?></a>.The Return Code from OnlyWire was <p><i><?php

$retcode=get_option(’onlywire_returncode’);
echo substr($retcode, 52, strlen($retcode)-56);

?></i></p> For further Information on Return Codes, please visit <a href="http://www.onlywire.com?api">OnlyWires API Page</a>. If you want, you can try to submit the item manually by <a href="http://www.onlywire.com/b/bmnoframe?u=<?php echo get_option(’onlywire_perm’);?>&t=<?php echo get_option(’onlywire_title’)?>">clicking on this link</a>.</p>
</div>
<?php
}

// Insert the mt_add_pages() sink into the plugin hook list for ‘admin_menu’
add_action(’admin_menu’, ‘mt_add_pages_onlywire’);
?>

 

 

UPDATE:

I am not yet sure if this works or not. Onlywire gave me this message:

Error - You have already submitted 6 items today. Due to spammers misusing the system you are not allowed to submit more than 5 per day. Your counter will reset at midnight Pacific Standard Time. If you have a legitmate use for submitting more items per day you can request to have this limit increased, send an email to info@onlywire.com and justify your reason for increasing this limit. Thank you for your understanding.

Even though this is the second bookmark I made today.

Rate this:
2.5

10 Responses to "Tag Support for the Onlywire Autosubmit Plugin"

1 | silentkiller

November 8th, 2007 at 12:13 am

Avatar

Plugin could not be activated because it triggered a fatal error.

Parse error: syntax error, unexpected T_STRING in /home/*********/public_html/wp-content/plugins/onlywire.php on line 52

2 | Stephan Miller

November 8th, 2007 at 6:51 am

Avatar

My plugin as edited above is actually still active here and I actually get a response back from Onlywire. It’s just not the response I want. You may have a missing semicolon in your plugin. Check around line 52. The only real changes in the file were:

if ($posttags) {
$tags = get_the_tags($post_ID);
foreach($tags as $tag) {
$taglist .= $tag->name." ";
}
}

And adding .”&tags=”.$taglist; at the end of:

$url="http://$username:$password@www.onlywire.com/api/add?
url=".$permalink."&title=".urlencode($post->post_title)."&tags=".$taglist;

3 | Stephan Miller

November 8th, 2007 at 6:54 am

Avatar

And I just found an error, not the one you show, but why it wouldn’t work no matter how I tried. What is $posttags?

4 | silentkiller

November 8th, 2007 at 6:57 am

Avatar

Hi,

I can’t find anything wrong with line 52 ..

function mt_add_pages_onlywire() {
// Add a new menu under Options:
add_options_page(’OnlyWire Options’, ‘OnlyWire Options’, 8, ‘onlywireoptions’, ‘mt_options_page_onlywire’);
}

By the way, is Onlywire still working? I tried submitting it manually and it doesn’t seem to be working.

5 | Stephan Miller

November 8th, 2007 at 9:41 am

Avatar


6 | Bob

January 10th, 2008 at 3:12 pm

Avatar

Stephan,
I just ran a quick test on OnlyWire. When I submitted a site, it actually only showed up on 3 of my bookmarking accounts. I still have 4 sites that I could not even create an account for. They have been down ever since I have been with OnlyWire. I had 8 accounts that were not working or just too much trouble to fool with. I added buttons to my tool bar for the rest. Spurl is supposed to take your information from del.icio.us. Not sure yet if that works. Are you having more success than this with OnlyWire?
Thanks,
Bob
http://BobWilloughby.com

Bob’s last blog post..Things are not always what they seem!

7 | Stephan Miller

January 10th, 2008 at 3:18 pm

Avatar

I gave up on this plugin. Some issue I don’t think is worth tracking down. Onlywire is slow and some of the posts only go through hours later it seems, but hey, it beats going to each and every site. There are a few other bookmark post aggregators out there but not with as many services as OnlyWire or with just a single interface. At least, the last time I checked.

There is software you can buy, but to me that jumps over the spam line. I line I used to skate in the Wild West Internet Days but not much any more.

8 | Jeff Houdyschell

March 6th, 2008 at 3:40 pm

Avatar

Getting the same Error - “You have already submitted 6 items today. Due to spammers misusing the system you are not allowed to submit more than 5 per day……..

Any fix or explaination on this yet?

Jeff Houdyschell’s last blog post..Adding AdSense Code Into A WordPress Theme

9 | Stephan Miller

March 6th, 2008 at 3:47 pm

Avatar

I gave up and stopped using it. Onlywire is too unstable. I left the post for reference in case any one wants to pursue this further.

10 | mesol

June 25th, 2008 at 12:14 am

Avatar

seem that onlywire already change their API and this plugin cannot be use anymore

mesol’s last blog post..Carli Banks @ Twistys

Comment Form

WTFMO



Flickr PhotoStream

  • CIMG4591
  • CIMG4590
  • CIMG4593
  • DeactivatePlugins

About

This is my blog about building sites, traffic and using those to make money from ecommerce sites, affiliate programs and blogging.