Broadcasting RSS Feeds with Twitterbot in Less Than 5 Minutes
Everyone is all atwitter about the Twitter web service. It’s a web-based broadcast instant messaging application where you can send updates by email or by SMS mobile. It has a limitation of 140 characters and is a lot like how people have always used their instant messenger away status (or their Facebook status). Like all public web communication people will lose their jobs and destroy relationships over Twitter before they realize that it’s all public, it’s all archived, and it’s all searchable (but you can restrict messages to only go to friends).
I’m not going to use Twitter to start posting all of the trivialities of my life, but I *am* interested in using it to broadcast my blog posts, my del.icio.us bookmarks, and the occasional aside (you can friend me here). Here is how you can do something similar using a program called Twitterbot by R. Tyler Ballance at the Unethical Blogger.
By the end of this guide you’ll have a program up and running that will download RSS feeds and broadcast them over your Twitter account.
There is a fast guide (download the program directly) and a not-as-fast guide (download the source code to the program).
UPDATE: 2007/03/26: Someone has created an rss2twitter application.
UPDATE: 2007/03/29: WordPress Plugin for automatically pinging your Twitter account with new blog posts.
UPDATE: 2007/04/03: I’ve switched to use twitterfeed.com and I’m liking it.
This article will outline how to use twitterbot to run your own server. Casual users should seriously consider twitterfeed/rss2twitter.
But what is it good for?
Why would you want to broadcast RSS feeds to your Twitter account? Well, RSS is becoming the glue of the Internet. Any web app worth it’s salt offers an RSS feed, usually many. So that really opens up the possibilities for the types of notifications you could use this for.
- Post links to photos from your Flickr photostream
- Post links to your latest blog posts
- Bookmark links in del.icio.us and automatically share them with your friends
- Post links to your StumbleUpon shared bookmarks
- Post links to your Digg submissions
- Post links whenever one of your blog posts is submitted to Digg (be careful because Digg bans at the drop of a hat these days)
The Fast Guide
- Download and unzip Twitterbot
- Install Mono if you don’t already have Microsoft .NET Framework installed
- Mono is an open source, cross-platform version of .NET
Enter Your Feeds
- Edit feeds.sample.xml with Wordpad (Right click, open with Wordpad)
- It was created on Unix so Notepad will have issues with the formatting — use Wordpad
- Fill in the name and url of the RSS feed you want to broadcast as well as the name and password of your twitter account.
<feeds> <feed name="//engtech" url="http://feeds.feedburner.com/engtech/" twitter="engtech" password="twitterpassword"/> </feeds>
- You can use more than one feed.
- Be careful with the & symbol! You have to convert it to &
- Another reason why YAML is better for configs than XML :)
- Save the file.
Running Twitterbot from a Batch File
This is for Windows users. Unix/Mac guys can run twitterbot directly from the command line using “mono Twitterbot.exe”.
- Right click and choose New >> Text Document and rename it to twitterbot.bat
- Right click twitterbot.bat and choose Edit
- Copy the following into Notepad:
@echo off Twitterbot.exe feeds.sample.xml 30 yes echo Twitterbot exited pause
- If you do not have Microsoft .NET installed and are using Mono change the second line to:
mono Twitterbot.exe feeds.sample.xml 30 yes
- Double click on twitterbot.bat to run it.
Now you have a program running on your computer that will periodically update twitter with your RSS feed. Many thanks to R. Tyler Ballance at the Unethical Blogger for writing this! You can add me to your Twitter friendslist by clicking on this link.
The only pain is that you need a computer that is on all the time for running Twitterbot on. Or you could add twitterbot.bat to your Start Menu >> Startup folder so that it starts every time you reboot your computer.
- It is meant to run forever. If you start and stop the program it will send out duplicates.
- If it has a lot of URLs to post it doesn’t space them out nicely (again, meant to run forever so not a large issue).
- It doesn’t keep trying to post a link on failure (TinyUrl and Twitter can both time out because of being overloaded).
If you see the following it means you didn’t put in the correct password for your Twitter account.
Received exception! System.Net.WebException: The remote server returned an error: (401) Unauthorized . at System.Net.HttpWebRequest.GetResponse() at Twitterbot.PostToTwitter(Feed feed, String post) [2007-03-22 12:50:42 AM] Failed to post to twitter!
The Not As Fast Guide
Most people should use the Fast Guide up above. This one checks out the Twitterbot source code from Subversion instead of downloading it as a zip file.
Download Twitterbot Using TortoiseSVN (Windows)
- Install TortoiseSVN
- Open Windows Explorer (press WindowsKey-E)
- Create a new directory/folder called twitterbot
- Right-click on the twitterbot directory and choose SVN Checkout
- Enter this URL and press Ok
OR Download Twitterbot Under Linux
- Create a directory for twitterbot
- Run this command:
svn co svn://svn.geekisp.com/bleep/trunk/Twitterbot
This will download the files, now follow the same instructions as in the quick guide above starting at “Enter Your Feeds”.
Subscribe to comments with RSS.
Comments are closed.