Sunday, August 16, 2009

Google Voice SMS pushed to Iphone using Prowl + Python

I have been using Google voice for sometime. I am having a hard time figuring out what it could be useful for however. I like their SMS feature and use it to shed load from my phone company's messaging plan. There is a major drawback to using Google Voice for SMS though. Google does not allow you to send email or other notifications when you receive an SMS. So you will have to visit Google Voice using your browser to check for SMS messages.

This is probably something Google left out so it does not anger phone companies. I can see how people will switch to using Google SMS if email notifications were sent when messages are received. It will literally provide you with a free unlimited texting plan with your own phone number.

Mikeyk came up with a hack to create a Google Voice client to send push notification to Iphones. In short, you will need to have a computer connected to the internet running a python script which will send push notifications to your prowl client. In this case, the prowl client will be installed on your Iphone.

Mikeyk's instructions are fairly self explanatory in setting up his client. I recently did this and it took less than 20 mins to set it up correctly. Having a little bit of python experience definitely helps.

A little more detail about my setup: I installed the scripts on my diminutive Ubuntu 9.04 workstation. I already had python installed so I just added the three dependency package that Mikeyk mentions. One thing that was a little interesting to me was that I didn't quite know how to download the scripts from github! Silly me! I later noticed that github provides a download option which basically creates a zip or tar of all the files the source author had published. So make sure to download Mikeyk's code from github unless you like copy pasting and indenting Python code.

I did run into a few small issues trying to run the code. When I run the script, it keeps telling me that it can't read the cfile (credential file) but it does extract the values. So no worries there. It was clearly getting some sort of exception trying to read the credential file and was printing out the general exception message. I was being lazy and didn't delve much into it.

The other issue I ran into was, python kept telling me it needed a float type variable to store the sleep time (loop interval) which I had set to 60. Again being lazy I just hard coded the value 60 into the script, as shown below which took care of it. To my defense, I had to meet my friends for lunch and I was running late!

Excerpt from mikeyk's code - these are the last three lines from the prowlgooglevoice.py script:

while True:
# uncomment below for debugging
# print 'sleeping...'
     gv.check()
     sleep(sleep_time)

Python was complaining about the sleep_time variable, so I replaced it with the value 60, lame!

It seems to working great for me so far. I received close to 20 texts through Google voice yesterday and got notification for all of them.

I can almost say good bye to my ATT messaging plan (which I won't) if I wanted to and just use Google Voice for SMS. Give it a try if you send a lot of text messages. It's not very convenient but does work for many. I am hoping that Fring will come up with a plugin to Google Voice which will make it easy to send SMS messages from smart phones.

Cheers!

Credits: Mikeyk

No comments:

Post a Comment