Friday, December 11, 2009

Audio based interfaces for Twitter Part 3

At this point, I have the ability to listen to my /home feed on a rotation of my choosing, as well as @public_timeline, and have made an online radio station to explain/share the experience. The very night that I implemented the bluetooth audio feed of my /home feed, I said to myself: "How great would it be if I could actually tweet via voice?". I already knew what the state of speech to text offerings for Linux which was there really isn't much out there from what I could tell. Then on November 10th, I saw the following post on http://www.hackaday.com: http://hackaday.com/2009/11/10/voice-controlled-led-sign It took me about a minute to think of an easy way to do the same thing except send the message to Twitter.


Thanks to the generosity of someone I chat with on Twitter, I was able to get a Google Voice account. I set up the Google Voice account and sent it to my cell phone. I tested it by leaving a voicemail. Sure enough it had emailed a copy of the transcription to Gmail. Next I set up a mail forward to a free mailbox on my ISP. I then configured Getmail to check and remove any messages from my isp. I then set up a Bash script to output the file to a generic name, run sed to edit out everything that is not text, create a variable exectweet="`cat tweet`" , and insert the variable into the status portion of the curl post, delete any messages in the inbox (rm ~/inbox/*), sleep for two minutes, and then check for messages and repeat. The reason for sleeping two minutes is to allow Google Voice enough time to transcribe the message and Gmail to forward the message to my ISP mail. It worked. Sort of.

There was no flaw in my aggregation or editing in the script. This part worked as expected. The let down came with the accuracy of Google Voice. It isn't. You can view two days worth of weird status updates at my test account http://twitter.com/mcteststein. After those last two messages came through clean, I connected the script to my POTUSCamacho account and threw caution to the wind. I tweeted blind every once in a while. I did not check the accuracy of the messages. When I got home and checked them, they ranged from close but not quite to way off base. I have since "mothballed" any further research into using this as a way to tweet for the time being. Some things are too good to be true sometimes.

I would like to quickly cover some auto status update work I have done on Twitter that runs the status posts of http://twitter.com/timelineradio. To do this I need to tangent for just a second to two simpler projects I have on Twitter. They are http://twitter.com/cl0ckbot and http://twitter.com/baitbot Cl0ckbot was just a simple bot to see if I could throw one together quickly. I actually keep it running because it serves as nice time hash marks for checking Twitter via the web. I decided to make baitbot to see how much spam I could catch with a simple bot. Baitbot repeats a set of ten different programmed responses on rotation for forty minutes of every hour (This is done to stay below the API limit of 1000 tweets a day which works out to be 41.6 possible every hour). The responses are absurd comments with a popular word or two sprinkled in and a warning message not to follow it. What is interesting about the bot is it repeats the exact same message (sort of) more than once a day (which Twitter will allow you to do). The trick to this is in this line of a status variable in the baitbot script: `date +%S%M` For those that don't know, I used that to sprinkle in the seconds and the minutes of the current hour allowing for a changing two digit number, that does not repeat in a day, in every status message. It makes it "different" as far as Twitter is concerned. I adapted this technique to make an automated status script to advertise the radio station on twitter. The script runs every five minutes of every hour. I did not want it to post constantly, just enough to make it hit in a search for the @public_timeline.

I am going to wrap up the series in saying that I will continue to improve upon my scripts and the overall quality of the radio station portion of the project. If you have comments and suggestions pleased find me on Twitter. If I have interested you, I suggest taking a look at the Twitter API. It really is so easy a cave man could do it.

Stay tuned for more projects and musings.

No comments:

Post a Comment