Retweeting the Right Way

Just released an update to ReTweeter (1.1), which now uses the Twitter API for Retweeting. This means that instead of the traditional “RT: @username” syntax, the retweeted tweets will now show Twitter’s little retweet icon and the link to the original tweet (where it says “about 4 hrs ago”) preserved, and the retweeting user’s name at the bottom, like so:

Screencap by Jeronimo Palacios - http://www.flickr.com/photos/jeronimo_palacios/4093181811/
Instead of what Retweeter used to produce, which looked more like this (rt: @username):

rt: @drunkjeckman Let's also see that new format with the rt: and the @ to the original author #jeckman

Thanks to Cody Wilson at QC Co-Lab (@qccoloab) for the patch for this. Of course, if you’d like to keep the old format, you can just set ‘USE_OLD_FORMAT’ to true in the configuration section, and retweeter will keep using the older format.

I’ve also started storing the md5 hash (required for OAuth) in the database instead of recalculating it each time retweeter gets called. (If you ever need to change your md5 hash, say because you’ve regenerated your OAuth token at Twitter, just delete the row in the ‘conf’ table and retweeter will create a new hash the next time it runs).

Note that you will have to alter database tables if you’ve previously used a version of ReTweeter from 1.0 or before – but I’ve included the necessary SQL statements in the README included with the download.

Post navigation

13 Comments

Did you post a download link somewhere in there and I missed it? I found the new version by following the link in the previous post about retweeter and changing the version number. I don’t see this project on your code page. Are there any plans to host it on github or google code?

I’m about to give it a go on the @WPBook account so we can pull in the #wpbook hash tag. I’ll let you know how it goes.

This looks like something fun/useful to play around with. Thanks John!

Sorry for the comment spam but I found a bug. I kept getting this error “Could not select tweets not tweetedUnknown column ‘PlainPostID’ in ‘field list'” looks like in the SQL statement in the readme you have “PostPlainID” instead of “PlainPostID” I changed the SQL instead of the code but either one would work.

Also a suggestion would be in the retweeter.php change “$consumer_request” to “$consumer_secret” as I was trying to figure out if you wanted the secret or Request token URL

Again sorry for the comment spam and it looks like I got everything up and running!

Updated retweeter 1.1 – just fixed the SQL statements in the readme and replaced the existing 1.1, so use the same download link.

Hadn’t thought about putting this on Google Code or GitHub as I thought it would be kind of a one time hack – but if there’s interest in continuing to develop it (perhaps even adding a web interface for entering config info, and doing a true OAuth exchange with Twitter) I would certainly be up for it.

When I was installing this I was thinking “It sure would be nice to have a web interface” and also thought that about logs and such. I just don’t know if I’ll ever find the time to write one or that you want me following you around and geting invovled with all your project :)

Thank you for your reply!
I was not able to figure it out, I created another app and it worked without the error code.

However, there is something I noticed and wish to request for the next release:

-When the application retweet, it takes some topic and use “rt: @username….” but what is happening is that this action is ending up as such:
rt: @username rt: @username rt: @username rt: @originalusername…..(the rest of the tweet).
-Having the possibility to specify a hashtag (or multiple) separately from the username. That way the query can be more precise.

In the end, I really appreciate your effort in making this open to users like me and others around the web.

Status code 401 would suggest that your authentication credentials are either not present or somehow invalid – have you entered the requisite information into the script?: consumer_key, consumer_secret, oauth token, and oauth secret?