bot

Twitterbot: Lessons Learned

Tom's picture
Tags: 

It was too terribly long ago that I posted a simple Twitterbot here. I'm sure you'll be absolutely shocked to learn that it had a few, uh, shortcomings. If you're making a TwitterBot (and particularly one in Ruby), here's some advice:

let someone else build your SMS gateway

Tom's picture
Tags: 

I've written my fair share of fly-by-night SMS services. Not for clients, of course — when someone needs a mobile campaign we talk to folks who live and breath text messaging. But I've hacked together a few hobby SMS apps on the cheap. There was this one, for example, which used email-to-SMS gateway functionality to provide a rating system for SXSW panels. Before that was LastCall, a genuine (if not shortcoded) SMS app I wrote for DCist that allowed users to check subway times, query OpenTable for available reservations and perform a number of other questionably-useful functions.

The DCist mobile service was a nightmare to put together. I bought a cracked-screen cellphone off Ebay, an unlimited-SMS mobile account and went through a half-dozen USB-to-serial cables before finding one with a Linux-compatible chipset. The software I used to spool messages from the phone to the server was a bit flaky, requiring a ton of configuration. And then WMATA changed their website and something went screwy, sending tons of unwanted text messages to hapless subscribers. The whole effort took months. The moral was clear: rolling your own SMS gateway is a huge pain in the butt.

That's why I used the email-to-SMS approach for the SXSW service. It worked beautifully, but everyone knows it's a little unprofessional — the mobile carriers can always shut you down, and users get confused when asked to send a text message to an email address.

RSS To AIM Bot

Tom's picture
Tags: 

There's a pretty popular blog with extremely active comment threads that I like to participate in. The threads are so active that they're pretty much the blog's entire raison d'etre — posts are conversation-starters more than anything else. An average thread runs for at least a hundred comments, and there are several of them a day.

The conversation is fun, but it can be a real pain to keep up with it. Participants are mostly reduced to constantly-refreshing their tiny comment pop-up windows. If you've got a real job to do, it becomes nearly impossible to be a part of the thread.

I wasn't too happy about that, so I cooked up a bot to solve the problem. Instead of constantly-querying threads I can simply tell the bot to pay attention to a particular discussion and IM me when new comments in it show up in the comment RSS feed. I was pleasantly surprised by how well this ended up working, so I've generalized the code a (very) little and thought I'd post it here.

A few things, though. First, the bot uses the AIM network. I realize that the cool kids are all playing with Jabber. But I only use GTalk and AIM, and my mostly-uninformed impression is that Google's implementation of Jabber may not be as open as the protocol's designers intended. Besides, AIM bots are a pretty well-developed technology.

Second, the bot was designed with a very specific purpose and platform in mind. It's likely that you'll have to mess with some Perl to adapt it to whatever RSS-and-IM-involving application you have in mind. But it should at least serve as a good starting point.

With that said, let me know if you have a use for it or need some help bending it to your will.