In the previous series, 5 Tips for Using Twitter with Ruby, we concentrated on the technical aspects of connecting to Twitter, making API calls and parsing the data returned. In this series, all of that will be handled by the excellent Twitter Gem by John Nunemaker and the focus will be on practical scripts you can write in Ruby.
Most of the time it's polite to follow people who follow you on Twitter. If you find that most of the time, the people following you have similar enough interests that you want to hear what they have to say, it's easier to automatically follow them as they follow you. This script uses the Twitter API to get a list of followers, get a list of the people following you, and automatically follow the people you're not yet following.
If you have a blog or a website, you probably post an update on Twitter whenever you publish a new article. This script takes the copy and paste work out of it, and simply reads your RSS feed. Any new RSS items it sees, it will create a new update for. This also shows how to use the ShortURL gem to shorten URLs from Ruby and SimpleRSS to parse RSS feeds.
This script will monitor your friends' timelines on Twitter and, whenever there's a new update, will send you an instant message using Jabber. It can also be used to propagate your Twitter timeline outside of Twitter, and send all the updates you receive to anyone with Jabber. This article also covers using the XMPP4R gem to interface with Jabber.