Twitter Related Applications
This page collects code snippets and applications related to Twitter, mostly using the Twitter API. (I’m jeckman on Twitter).
Retweeter
Retweeter is a fairly simple PHP script, designed to be run from a cron job. It was inspired by this blog post by Kosso though it doesn’t exactly follow the algorithm he outlines. Thanks also to Mark Reeves of Refresh Boston and Alex King’s TwitterTools WordPress plugin for examples on accessing the Twitter API and storing tweets.
Retweeter accesses a Twitter account and turns it into a “broadcast” repeater.
What it does is to:
- scan the tweets of all those whom it follows
- look in those tweets for a hashtag, which looks like “#username” (where “username” is replaced by the username of the account to which you’ve associated it)
- When it finds tweets containing the hashtag, it retweets them, prefixed with the originator’s username
This lets you use twitter like an email list.
For example, at SXSWi 2008, I set up a twitter account called vegsxsw. Any user who is followed by vegsxsw (and I follow back everyone who follows that account) can write a tweet using the hashtag #vegsxsw, and that tweet will get reposted, prefixed by their twitter screen name.
RSS To Twitter
RSS to Twitter is a script by Paul Stamatiou - see RSS to Twitter Using PHP. Paul’s script itself relies on Last RSS.
Unfortunately for those of us on hosts like Dreamhost which do not allow fopen calls in PHP to open remote urls, the LastRSS script was failing.
All I’ve done in the below archive is to modify the Last RSS “parse.php” file included in Paul’s script to use Curl to get the RSS file, rather than fopen. This should enable it to work on more hosts.





Trackback url for this post: http://www.openparenthesis.org/code/twitter-api/trackback
Leave a Reply