SMS Agent project idea

Tired of not having an iPhone, I decided to see what I could do with my existing horriblePhone and free incoming SMS. It turns out that my cell provider (bell.ca) (as well as quite a few others) provide a free SMS-to-email (and vice versa) service. Since Gmail provides optional POP3 and SMTP interfaces, and CPAN has modules for dealing them, I wondered what I could accomplish with a little bit of Perl, a 15 cent SMS, and ~140 character page breaks.

Right now, I have a hacked-together script running every ten seconds which reads a Gmail account and dispatches requests based on the first word to custom handlers (no strict ‘refs’ for the win.) It emails back the results ~130 characters at a time, in reverse for easier reading, and two seconds apart to keep messages in order. So far, the only usable handler is “w” for Wikipedia. Here’s an example communicae (with order reversed again for readability):

horriblePhone:
w porkchop
smsAgent:
A 'pork chop' is a chop of pork.

The center cut or pork loin chop includes a large T shaped bone, and is structurally>
smsAgent:
<similar to the beef t-bone steak. Rib chops come from the rib portion of the loin, and are similar to rib eye steaks.>
smsAgent:
<Blade or shoulder chops are cut from the shoulder end of the loin, and tend to contain large amounts of connective>
smsAgent:
<tissue. The sirloin chop is taken from the (rear) leg end and also contains a large amount of connective tissue.

The>
smsAgent:
<so-called "Iowa Chop" is a thick center cut. The term was coined in 1976 by the Iowa Pork Producers Association.

Next up is database storage (so that I can implement a “more” handler), refactoring into sane modules, setting the thing up as a service which runs all the time and only reconnects to POP3 when necessary, and adding more useful handlers. Some ideas include Google Transit, Translink current conditions, dictionary/thesaurus, and 411+address.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: