Monday, April 12, 2010

Text Message Response Bot

For the last few months (Jan-April 2010) in Linux Journal, there has been an ongoing article on Parsing Your Twitter Stream - Twitter response bot, by Dave Taylor.

http://www.linuxjournal.com/magazine/work-shell-parsing-your-twitter-stream

http://twitter.com/davesbot

I'll post an excerpt below because I can see such a scripted bot useful for ham radio in conjunction with APRS/Packet and the slow speed user-messages portion of D-Star.

When used in conjunction with a Vellman K8055 Board or homebrew serial or parallel port device you can control external devices by short text messages.


Last month, we circled back to Twitter and started developing a shell script that lets you actually parse and respond to queries sent via Twitter. The idea was that if you were a store, for example, a tweet of “hours?” could be answered automatically with a response tweet of the store’s hours—simple, but interesting nonetheless.

ftp.linuxjournal.com/pub/lj/listings/issue191/10695.tgz

For fun, I’ll let people send the query “time” and get the current output of the date command too, just to demonstrate how that might work. Here’s the code block:if [ "$msg" == "time" ] ; then
echo "@$id asked for the time"
$tweet "@$name the local time on our server is $(date)"
fi

No comments: