1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Tweeting, Following and Updating on Twitter


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.

1. Automatically Follow Followers on Twitter

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.

2. Update Twitter From an RSS Feed

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.

3. Be Notified of New Twitter Updates by IM

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.
  1. About.com
  2. Technology
  3. Ruby
  4. Networking
  5. 3 Practical Ruby Scripts for Twitter

©2014 About.com. All rights reserved.