Twitter Updater
Plugin Description
This plugin will let you automatically update your Twitter.com status with your most recent blog post. There are a few options to how the display will look when it updates.
02/19/2008
- Plugin was updated to automatically utilize tinyurl.com’s API to publish links.
08/06/2008
- Plugin was updated with correct version and links, no actual code changes.
Plugin Credit: this plugin was originally created by Victoria, then updated by Jonathan Dingman.
- Download the plugin (see above link.)
- Unzip the compressed file to your hard drive.
- Upload the “twitter_updater” folder to your wp-content/plugins folder.
- Browse to the Plugins page under wp-admin and activate the plugin.
- Setting the options: Browse to Manage->Twitter Updater.
- On this page, you can set any options you would like to.
- IMPORTANT: Make sure you enter your Twitter username and password, then click on “save login”
- That’s it! Now your Twitter.com status will be updated every time you publish a new post.
09/03/2008 at 11:23 am Permalink
Very well done. The option to turn off tweets for drafts and edits is a great one.
01/05/2008 at 6:07 pm Permalink
I’ve followed the above steps for installation but something doesn’t look right.
I’m getting the title to pass through but not the url link. Here’s an example:
http://twitter.com/kyun/statuses/801533565
01/05/2008 at 6:11 pm Permalink
Prashant,
After the settings, you’ll see a checkbox that says “link to blog”, make sure that is checked as that’s what creates the actual linkback using tinyURL.
01/05/2008 at 8:55 pm Permalink
I have that selected.
Wondering if the apostrophe in the title has anything to do with this?
16/05/2008 at 6:29 am Permalink
Hey, great plugin. Really appreciate you adding TinyURL support.
One issue I’ve found with it - it seems to cut out when there is an ampersand in the title.
For example, the title for a blog post was this…
“Video of the Week: Nick Cave & The Bad Seeds - More News From Nowhere”
but output into Twitter as:
“Video of the Week: Nick Cave &”
And thus it cuts off the TinyURL as well. Is there a simple way to fix this?
Best
Alex
16/05/2008 at 6:30 am Permalink
Slight amend to previous comment:
It actually output in Twitter as
“Video of the Week: Nick Cave”
19/05/2008 at 1:21 am Permalink
I installed the plugin as described above, but it doesn’t seem to be Updater_v2. My blog is seeing it as v1. Any ideas what’s happening there?
20/05/2008 at 11:43 pm Permalink
@alex: I’ll take a look at it to make sure it filters through all characters.
@david: I’ll take a look at the versioning to make sure it’s correct, thanks for the heads up.
25/05/2008 at 3:16 pm Permalink
Hi!
The Plug-In doesn´t work completely. It only updates “existing posts” and “new post edit”. Thats all. What do I wrong?
H
30/05/2008 at 8:43 pm Permalink
@Henning: I’m not quite sure what you mean…what’s “not working”?
24/06/2008 at 7:28 pm Permalink
Hey Jonathan,
did you check because of the versioning, since it still says it’s 1.1 and by Victoria Chan, but it works
09/07/2008 at 9:59 pm Permalink
@Prashant: I’m having the exact same issue. I also have the appropriate checkboxes selected, and don’t get links in my Twitter posts.
@Jonathan: My Twitter registered email address uses Gmail address aliases. I wonder if it’s disrupting the string manipulation in the plug-in.
For example, myGmailAddress+Twitter.Update@gmail.com
06/08/2008 at 1:57 pm Permalink
@Bill,
Hmm shouldn’t cause any issues, but I’ll take a look at being able to use email addresses as a login.
15/10/2008 at 12:00 am Permalink
I’m getting two tweets every time I post … have I done something wrong or is there a fix for this? thanks
24/10/2008 at 11:42 am Permalink
Hi
I too am getting two updates with different tinyurl’s - is this correct?
26/10/2008 at 7:07 am Permalink
Works fine this great plugin. Simple and effective. One problem. It also publishes my scheduled posts to twitter. You can even read the upcoming post. I can disable the link in settings but than the published posts will not be linked. So is it possible to schedule posts without being published directly to my twitter blog?
Thanks Dr Shock
02/11/2008 at 12:38 pm Permalink
This plugin doesn’t fix the double tweets.
05/11/2008 at 5:02 pm Permalink
Everyone: I haven’t had a chance to fix the plugin yet for the double tweets or the publishing ahead of a scheduled time. As a note to everyone, I only ported over the plugin to utilize TinyURL, I’m not the original author of the plugin.
I will try to get it fixed soon.
30/11/2008 at 2:17 am Permalink
Please help:
I installed the plugin and activated it (I could see the plugin activation). However, when I went to the “Settings” page the plugin is not there. So, I am not able to edit it.
I deacrivated it, and reinstalled it again, but no luck.
What is the problem? Please help.
30/11/2008 at 7:17 pm Permalink
Double tweets . . . is there something in the code I can fix? Please advise.
03/12/2008 at 1:37 pm Permalink
I have WP2.6 installed, along with v2 of this plugin…
1. I have noticed another bug, possibly with this plugin, possibly with wordpress (which may or may not be related to the double-tweet thing). If I am writing a new post, and instead of clicking “Publish”, I just move the “status” setting to “published” and I click save, the blog is saved and published, but my tweet for Publishing a blog doesn’t happen (probably because the logic in the plugin interprets this as a SAVE, not as a publish). In other words, the logic that looks at the value of ‘publish’ may not be taking into account this type of Save action that I do, but wordpress definitely considers this a valid “publish” action for the blog post.
2. I am also having the double tweet problem, if instead of that status/save method I just described, I just do the “Publish” button itself.
So, after looking at a few things, I think the double-tweet might be because registered “save” handlers are called twice, once when the post is SAVED and once when it is PUBLISHED. The problem might be that ‘prev_status’ is still “draft” in both cases, and that ‘publish’ is also still “Publish”, so this is interpreted by the plugin’s logic as two valid publishes.
Depending on how you look at this, it might be a bug with wordpress (why would it need to call the handlers a second time if the publish is all one action?) or it might be a bug with this plugin that it might be need check with twitter that it didn’t just post the same tweet already, or the plugin might need to look at some other set of values to determine if its being called a duplicate time.
05/12/2008 at 7:56 pm Permalink
@everyone:
Unfortunately, there are a few bugs in the plugin.
However, I didn’t originall write the plugin — but I’m thinking about spending the time to rewrite it from scratch and re-publish it as a new plugin.
I will keep everyone posted when the updated version is available.
08/12/2008 at 11:15 pm Permalink
@jonathan
Do you need any help?
12/12/2008 at 12:59 pm Permalink
Your plugin stopped working when I updated WordPress to v 2.7.
17/12/2008 at 3:31 pm Permalink
I’m using WP v 2.6 and get the following error when publishing a post:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/[mydomain]/public_html/blog/wp-content/plugins/twitter-updater-using-tinyurl/twitter_updater.php on line 58
Warning: file_get_contents(http://tinyurl.com/api-create.php?url=http://www.itjobcoach.com/46-revision/) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/[mydomain]/public_html/blog/wp-content/plugins/twitter-updater-using-tinyurl/twitter_updater.php on line 58
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/[mydomain]/public_html/blog/wp-content/plugins/twitter-updater-using-tinyurl/twitter_updater.php on line 58
Warning: file_get_contents(http://tinyurl.com/api-create.php?url=http://www.itjobcoach.com/testing-twitter-update/) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/[mydomain]/public_html/blog/wp-content/plugins/twitter-updater-using-tinyurl/twitter_updater.php on line 58
Warning: Cannot modify header information - headers already sent by (output started at /home/[mydomain]/public_html/blog/wp-content/plugins/twitter-updater-using-tinyurl/twitter_updater.php:58) in /home/[mydomain]/public_html/blog/wp-includes/pluggable.php on line 770
27/12/2008 at 1:46 pm Permalink
@Richard, that’s a configuration problem with your host that you would need to talk to them about.
@Adam, sure, if you have time, any help would be appreciated. My time has been slim to be able to work on plugins lately.
01/01/2009 at 4:22 pm Permalink
It appears to have stopped working with the WP 2.7 upgrade. Any plans to make it work again? Or something we can do to get it working? Thanks ahead of time!
03/01/2009 at 1:28 pm Permalink
Is there anyway to keep it from immediately announcing posts you have set to go out at a later date?
07/01/2009 at 12:59 pm Permalink
I’m with John - your plugin stopped working when I upgraded to WP2.7 - which is a shame, because it was helpful…
05/03/2009 at 11:33 pm Permalink
Will this plugin move onto working with WP2.7?
10/03/2009 at 8:07 am Permalink
For some reason, my twitters are posting twice. Can anyone help with this?
16/03/2009 at 9:43 pm Permalink
A hack to fix the double (or more) tweeting problem.
For my situation… I only care about making one tweet when the post first gets published. Adding this code will record each post ID that gets tweeted, and then never tweet again for that post ID. The problem is gone. Of course, this does not fix the problem if you want it to tweet when a post is updated, but I think you could move the code around in that function and it would be fixed.
To use, change $thackfile to a file location that PHP can write to and you’re all set. For some, leaving it as-is may work.
Add this code above line ~50 in the vc_twit function, just above “//is new post”:
/**
START DOUBLE TWEET ELIM HACK
*/
$thackfile = ‘twitter-updater-hack.txt’;
if(!file_exists($thackfile)) file_put_contents($thackfile, serialize(array()));
$thackdata = unserialize(file_get_contents($thackfile));
if(in_array($post_ID, $thackdata)) return $post_ID;
$thackdata[] = $post_ID;
file_put_contents($thackfile, serialize($thackdata));
/**
/END DOUBLE TWEET ELIM HACK
*/
A hack to fix the problem with escaped quotes being tweeted:
Change line 33 from:
fputs($fp, $twit);
To:
fputs($fp, str_replace(”\’”, “‘”, $twit));
19/03/2009 at 5:24 pm Permalink
I cant get this plugin to work. I have followed all the instructions, set the config and entered the email and password. I get no updates on my twitter page. I am running wordpress 2.7.1
Any ideas?
24/03/2009 at 11:21 pm Permalink
My problem is that Twitter updates are sent when I edit a post (as I select) but not when I actually create a post (which is also selected). I’m using Wordpress 2.7.1
25/03/2009 at 5:45 pm Permalink
Hi,
I’m a new user of your Twitter Updater Wordpress plugin and I’ve found and corrected a little single quote bug (cf. http://twitter.com/xavismeh ). So here is the fix in twitter_updater.php, line 89, just replace
$sendToTwitter = vc_doTwitterAPIPost('status='.$sentence, $twitterURI);with:$sendToTwitter = vc_doTwitterAPIPost('status='.stripslashes($sentence), $twitterURI);Thanks for this plugin !
26/03/2009 at 2:16 am Permalink
Having an issue with this plugin. It will update whenever I edit posts (and I think also on automatic saves of edits), but it won’t send an update to Twitter when a new post is made on my site, despite it being selected in the Wordpress options. Any ideas why this could be? Am using Wordpress 2.7.1.
30/03/2009 at 1:42 pm Permalink
I’m using this plugin not just for my blog, but for another blog that belongs to one of my webhosting clients.
Both wp blogs are 2.7, and have the latest version of this plug in.
The problem? It’s tweeting multiple times - this last time it tweeted 4 times, another time, though, it tweeted 6 times.
I’ve disabled all options but the new publish option, and it won’t always tweet a new publication. If I disable all options except update, it’ll do the same thing - multiple tweets.
Could this be related to the autosave function in wp? Could it be that every time there’s an autosave the updater thinks it’s a new or updated post?
Is there a way to resolve this issue? Thanks!
30/03/2009 at 4:42 pm Permalink
Looks like doesnt work in the new version 2.7.1
01/04/2009 at 10:09 am Permalink
i think it doesnt work with 2.7 …
08/04/2009 at 7:01 pm Permalink
Hello - just started using this plugin the other day. Great concept - letting Twitter automatically alert people to new posts, complete with automatically grabbing a TinyURL. Genius in concept. But in actual execution, it’s not doing as well.
I am using WordPress 2.7.1, and while I had no problems with installation, the plugin doesn’t seem to be obeying the configuration.
I only have it set to Tweet when I actually publish something. But most of the time, it never Tweets when I publish. I don’t know if they’re being rejected when Twitter is “too busy” , or if the Tweets are considered to be too long (thanks to long permalinks), or if it’s just plain not playing by the rules set in the config screen.
On the other hand, when I allow it to Tweet when I “update” an existing post, one update will result in THREE tweets, all with different TinyURLs.
I know that’s nothing new, after reading the previous comments, but those were a few months ago. Still no workarounds or newer versions? I know, I know, I can’t complain because it’s free. But it’s still frustrating to publish a post, then go to TinyURL, and then go to Twitter to manually do everything this plugin should be doing.
I wish I had better knowledge of programming languages so I could help out. My dream would be to see this plugin work flawlessly, AND also spit back a confirmation as to whether or not the tweet made it through. If a tweet doesn’t get through for either of the reasons above (server overload or too lengthy), it would be nice to be notified, and to have the chance to re-send and/or adjust it until it does get through. (And it would be nice if Tweets weren’t sent out early for posts that are scheduled to publish in the future.)
If there’s any hope for a new version coming soon, I’ll wait for it… this plugin is great because it’s just what I need, nothing more, nothing less. I know there are many similar plugins out there, but they all come with extra bells and whistles I don’t need, and I don’t think I’ve seen any that also do the automatic TinyURL’ing for you. But if it’s gonna be awhile, I guess I’ll just try some of the others.
08/04/2009 at 7:04 pm Permalink
@DaveWebb - Just read your latest comment (missed it before). I think the double and triple tweeting for updates must be triggered by 2.7.1’s automatic save feature. If you have this plugin set to Tweet whenever an existing article is re-saved, it must be getting triggered by both YOUR saves, as well as the WordPress auto-saves. Definitely something that should be disabled if/when there are bug fixes to the plugin… though I’m not sure if there’s a way for the plugin to “know” the difference between human saves and WP’s auto-saves.
10/04/2009 at 11:27 pm Permalink
Hi
This doesn’t work on 2.7.1
It does multiple tweets on saved drafts, but when you deselect it, and only have it ONCE the post has been PUBLISHED, it wont tweet.
Another thing too, the password doesn’t get saved in the box, it keeps removing itself after saving it.
AND there is no link the the SETTINGS Drop downmenu, I have to type the location of the tweet_update_manager.php to get there.
Any one found a plugin that works, or found a fix for this one?
thx
loz
11/04/2009 at 12:46 pm Permalink
confirmed, doesn’t auto-tweet a new post when Published with 2.7 or 2.7.1 (have two blogs running), but when I edit a post if that option is ticked it will send. what’s worse is if I have both ‘tweet with new post’ and ‘tweet with edited post’ ticked it will double-send.
could be useful, but these bugs will make me uninstall. cheers!
12/04/2009 at 5:02 pm Permalink
Hello,
I have it installed, and have entered all the info correctly. I have the right boxes checked. I can enter my Twitter email (thought it was going to be my Twitter username at first), and then enter my Twitter password, and click Save. I get no confirmation that it was accepted or went through correctly. I also have not ever seem any of my posts automatically posted to Twitter.
Im not sure what Im doing incorrectly. Can you help?
Thanks,
William
16/04/2009 at 10:48 pm Permalink
I just installed the Twitter Updater and am having a hard time finding browsing to the Manage section to set the options. Now, I’m new to Wordpress and more than likely am overlooking something super obvious…help!
21/04/2009 at 10:12 am Permalink
Please excuse this newbie question — I’ve installed the plugin but I figure out how to set up the options. From the Manage page when I click on Twitter Updater 2.0 it simply takes me to this page. The only options are to edit the code and deactivate the plugin. There is no “Manage” tab on my wordpress page, just a Plugins tab.
05/05/2009 at 10:59 am Permalink
Note that in wp 2.7 this plugin’s manager appears under “tools” and not “settings”. It baffled me for a few minutes
21/05/2009 at 6:44 am Permalink
Hi all, I’ve spent some time getting this plugin working with the latest version of Wordpress (2.7.1).
In the twitter_update.php file, replace the entire ‘vc_twit’ function with this code. I had to change the file permissions to 777 before I could edit it, might just be the way my server is configured/the plugin was installed though:
——————————————————————————
function vc_twit($post_ID) {
$twitterURI = "/statuses/update.xml";
$thisposttitle = $_POST['post_title'];
$thispostlink = get_permalink($post_ID);
$sentence = ”;
//This is not an autsave - take action
if($_POST['action'] !== ‘autosave’){
if($_POST['publish'] == ‘Publish’){
// publish new post
if(get_option(’newpost-published-update’) == ‘1′){
$sentence = get_option(’newpost-published-text’);
if(get_option(’newpost-published-showlink’) == ‘1′){
$tinyurl = file_get_contents(”http://tinyurl.com/api-create.php?url=”.$thispostlink);
$thisposttitle = $thisposttitle . ‘ (’ . $tinyurl .’)';
}
$sentence = str_replace ( ‘#title#’, $thisposttitle, $sentence);
}
}else if($_POST['action'] == ‘post’){
// create new post
if(get_option(’newpost-created-update’) == ‘1′){
$sentence = get_option(’newpost-created-text’);
$sentence = str_replace ( ‘#title#’, $thisposttitle, $sentence);
}
}else{
// edit new post
if(get_option(’newpost-edited-update’) == ‘1′){
$sentence = get_option(’newpost-edited-text’);
$sentence = str_replace ( ‘#title#’, $thisposttitle, $sentence);
}
}
}else{
// is old post
if(get_option(’oldpost-edited-update’) == ‘1′){
$sentence = get_option(’oldpost-edited-text’);
if(get_option(’oldpost-edited-showlink’) == ‘1′){
$thisposttitle = $thisposttitle . ‘ ( ‘ . $thispostlink . ‘ )’;
}
$sentence = str_replace ( ‘#title#’, $thisposttitle, $sentence);
}
}
//If the tweet has been formed, check to make sure the post exists as a final product and then post an update
//This fixes a double posting to twitter issue
if($sentence != ”){
global $wpdb;
$result = $wpdb->get_row(”SELECT * FROM wp_posts WHERE id = ‘” . $post_ID . “‘ && post_status = ‘publish’ && post_type = ‘post’”, ‘ARRAY_A’);
if(strlen($result['post_name']) > 0){
$sendToTwitter = vc_doTwitterAPIPost(’status=’.$sentence, $twitterURI);
}
}
return $post_ID;
}
——————————————————————————
The modifications are as follows:
-(Around line 50) Check to see if the post is auto-saving, if so do not post anything to twitter. If not, proceed as original file did.
-This is what was breaking the things entirely.
-(Around line 88) If it’s time to post to twitter, make sure the post exists in the database as a published and only then, post to twitter.
-This fixes the double update bug.
——————————————————————————
I think that’s all I changed!
Will try and subscribe to this thread for any questions but I am notoriously bad with RSS feeds.
Happy blogging.
26/05/2009 at 12:25 pm Permalink
Where is Browse to Manage->Twitter Updater
I do not hae a header that says Manage, or at least I cannot find it.
28/05/2009 at 10:57 am Permalink
I am too stupid!
Where do I click to setup the plugin?
Picture of my wordpress
http://bit.ly/ARooz
04/06/2009 at 11:30 am Permalink
Hi Jonathan,
I have WP 2.7.1 and I am using the current version of the Twitter Updater. First, I cannot seem to locate the Manager option even under the “Tools” section according to Simon. Second, it isn’t even updating my twitter account, but that may be because I haven’t set the settings portion of it. For now I have deactivated it and am awaiting an update or an explanation of what I can do. Thanx for the plugin if you can get it to work with WP v.2.7.1.
10/06/2009 at 3:03 am Permalink
When will you release a WP2.71 version that works?
13/06/2009 at 12:55 am Permalink
I’m confused. In step 7 of the installation instructions, it reads:
In the blog setup page though, the plugin requests the following credentials:
Which one is it, the Twitter email address or the Twitter username?
15/06/2009 at 3:38 am Permalink
My issue is that after I install the plugin - I don’t know where to go set the options. Usually all my plugins settings appear under the setting menu of my navigation bar on the left.
I have no clue whats going on here. I have deleted and reinstalled- both manually (ftp) and through the wordpress system.
Please advise