Prowl notifications for Google Voice

An iPhone client for Growl available on the App Store.
mikeyk
Harmless
Posts: 3
Joined: Thu Jul 16, 2009 11:38 am

Prowl notifications for Google Voice

Postby mikeyk » Thu Jul 16, 2009 11:42 am

Hi there,

Just got my Google Voice invite tonight but was frustrated by lack of push SMS notifications. So...decided to write it myself!

http://github.com/mikeyk/googlevoicenotify/tree/master

There's actually two parts to this, a generic GoogleVoiceNotify class that accepts any number of custom listeners, and a Prowl listener that I wrote (more instructions in the README) that calls that class. Try it out and let me know what you think! Only requirement (besides a GV account) is a Prowl API key and the BeautifulSoup python library (you can do sudo easy_install BeautifulSoup).

Cheers,
Mike

User avatar
zac
Cocoaforge Admin
Posts: 1518
Joined: Sun Mar 27, 2005 3:19 pm
Contact:

Re: Prowl notifications for Google Voice

Postby zac » Sat Jul 18, 2009 1:43 am

Since I recently got my Google Voice invite, this might prove to be a very useful script. Cool. :)

kjconrad
Muffin
Posts: 30
Joined: Sat Jul 18, 2009 5:41 am

Re: Prowl notifications for Google Voice

Postby kjconrad » Sat Jul 18, 2009 5:45 am

Got this running and it's working great!! I did have to install a couple extra things that weren't noted in the read me to get it to work properly (simplejson, prowlpy, httlib2) but now things are running great! Thanks so much for putting the work into this.

Question, is there a way to get the notifications to stop replacing the spaces with "%20"?



edit:

I actually found the answer is the Gmail thread. If you comment out a few lines from prowlpy the notifications come through great, I don't know if this would effect anything else, but so far I'm only using the GV python script so ymmv:

xiechaos wrote:commenting out line line 35 to 38 seems solves this problem for me:
35 #application = urllib.quote(str(application))
36 #event = urllib.quote(str(event))
37 #description = urllib.quote(str(description))
38 #priority = urllib.quote(str(priority))

kconger
Harmless
Posts: 2
Joined: Fri Jul 24, 2009 3:06 pm

Re: Prowl notifications for Google Voice

Postby kconger » Fri Jul 24, 2009 3:12 pm

Hi,

Thanks for writing this script! Unfortunately its not sending notifications for me. It runs without error, I see the following in my terminal:

Code: Select all

checking
done checking, will sleep for  60  seconds


However no message is sent to Prowl as far as I can tell. I get no push notification and nothing shows up in Prowl.app. The example script in prowlpy works fine. I also have two unread SMS in my GV inbox. Any ideas or suggestions to troubleshoot?

tehElite
Harmless
Posts: 3
Joined: Thu Jul 30, 2009 10:48 pm

Re: Prowl notifications for Google Voice

Postby tehElite » Thu Jul 30, 2009 10:55 pm

I have followed this guide completely on my windows xp setup, to the last step.
i have the files from mikeyk, my credentials, prowlkey, and prowlpy.py in the prowl-gv of my C drive.
I am just wondering how to run this script. I tried running c:\prowl-gv\prowlgooglevoice.py in the command promt, and i get an error saying that there is no prowlkey in the folder. now i am SURE that i have a prowlkey file, because i renamed it again, deleted the file, made it again, copy-pasted the name from the readme, and i still get the error.
So i tried opening the file in PythonWin Editor, and clicked Run. The first time it started, it showed that it was checking... . But soon after, it hanged. Now every time i run the script using PythonWin Editor, it hangs.
So i tried opening in the Python Interactive Shell. i typed in python prowlgooglevoice.py , and it said that there was no such command.

now PLEASE tell me how to start the script so i can get push notifications.

tehElite
Harmless
Posts: 3
Joined: Thu Jul 30, 2009 10:48 pm

Re: Prowl notifications for Google Voice

Postby tehElite » Thu Jul 30, 2009 11:14 pm

Ok i googled it and i am now able to go further than before(i guess)
I dont have cookielib, and i cant downlaod it. I have Python 3.1 so shouldnt it come with it?

tehElite
Harmless
Posts: 3
Joined: Thu Jul 30, 2009 10:48 pm

Re: Prowl notifications for Google Voice

Postby tehElite » Fri Jul 31, 2009 1:37 am

I have tried EVERYTHING. I went through the code and commented out anything not supported(for some reason), and it still doesnt work.
can someone please upload a zip file of their folder of these google voice script. i dont mean just these 4 files mentioned in the readme above, i mean all the files. Is there anyway to get this working on Windows XP.

User avatar
zac
Cocoaforge Admin
Posts: 1518
Joined: Sun Mar 27, 2005 3:19 pm
Contact:

Re: Prowl notifications for Google Voice

Postby zac » Fri Jul 31, 2009 1:40 am

You should read over the Growl for Windows Google Voice page: http://blog.growlforwindows.com/2009/07 ... pport.html

mikeyk
Harmless
Posts: 3
Joined: Thu Jul 16, 2009 11:38 am

Re: Prowl notifications for Google Voice

Postby mikeyk » Fri Jul 31, 2009 7:12 am

Hi all,

Looks like there was a difference in how some versions of Python libraries handle the response, which I think I've fixed (working with a helpful end-user to debug). If you're running into an issue where it won't show your new messages, can you check out the new version at :

http://github.com/mikeyk/googlevoicenotify/tree/master

and let me know if it works?

I don't have a Windows machine and so unfortunately can't help debug the Windows issues, if you're on Windows then that GreaseMonkey script that zac linked to is probably a better bet.

americaskate
Harmless
Posts: 2
Joined: Sat Aug 01, 2009 12:01 am

Re: Prowl notifications for Google Voice

Postby americaskate » Sat Aug 01, 2009 12:09 am

I have tried doing everything in the guide.
But i have a small issue with httplib2.
After doing everything mikeyk wrote,when i try

python prowlgooglevoice.py

I get httplib2 giving me several syntax errors in
httplib2/_init_.py #i think it was this. i can double check.

Would any of you guys be able to help me out?
What could be causing this?
Any ideas?
Thanks.

hot_damn
Harmless
Posts: 6
Joined: Mon Aug 03, 2009 5:45 am

Re: Prowl notifications for Google Voice

Postby hot_damn » Mon Aug 03, 2009 5:48 am

Yay, I got it working! This is what I posted to the google voice help:

I've never used python scripts before and I am rusty at best on the command line, but after a bunch of fussing I got mikeyk's python scripts to work.

I initially tried the instructions at http://tech.xerces.com/google-voice-pus ... phone.geek, because they are clear and seem simple, but I found that they contradict mikeyk's own instructions when it comes to the configuration files. However, they lead you right getting started with python and installing dependencies.

Instead of using the xerces.com configuration files (he instructs you to make a file called 'credentials' and 'prowlkey' both placed in the directory with the python scripts), instead use the configuration files described by the author of the script: http://github.com/mikeyk/googlevoicenotify/tree/master. The author instructs you to make two hidden text files called '.prowlapi' and '.gvnotify' in your home directory.

On the MacOS, I had much better luck with EasyInstall than Macports for installing the dependencies. I first tried macports installations, which produced no errors, but the mikeyk scripts couldn't seem to call on the packages when needed. I reinstalled with easyinstall and it worked great.

as a side note- I couldn't get the script to use the .gvnotify configuration file, so I run it without. It just prompts me for my username and password when I startup the script instead of remembering it (no big).

americaskate
Harmless
Posts: 2
Joined: Sat Aug 01, 2009 12:01 am

Re: Prowl notifications for Google Voice

Postby americaskate » Mon Aug 03, 2009 6:57 pm

I was able to get everything to work when I used easy_install instead of installing dependencies with macports.
Not sure what was causing the problem.
Now the only problem I have is when trying to get the daemon to work.
It will quickly push the current unread sms's but then say "Cannot login to Google Voice" and quit running.
Anyone getting a similar problem?

kjconrad
Muffin
Posts: 30
Joined: Sat Jul 18, 2009 5:41 am

Re: Prowl notifications for Google Voice

Postby kjconrad » Tue Aug 11, 2009 12:42 am

MikeK Help!

Your script worked wonderfully for me until today. Google just changed the way new SMS's are handled (the sms's are no longer blue tinted, the have a green bar next to them, and there is no longer an "mark as read" button, SMS's are marked as read as soon as you click in the sms reply box, I'm sure some under the hood stuff too). I'm thinking this caused your script to quit working :(

I was using the original version with the "credentials" file. It was still logging in fine, and checking for SMS's with no problems, but it wasn't finding any new messages. I tried updating the script to the version that was released on the 31st of last month, and now I'm not sure if it's working at all... Does it still tell you when it's checking? Once I launch the script I just get a cursor that does nothing, no error, no "checking" message" no nothing.

I'm guessing this is also no longer working for you and that you'll have to fix it for yourself and then share the results with us?

hot_damn
Harmless
Posts: 6
Joined: Mon Aug 03, 2009 5:45 am

Re: Prowl notifications for Google Voice

Postby hot_damn » Wed Aug 12, 2009 3:38 am

The script stopped working for me today, and today my google voice account received the updates spoken of above (green bars, etc). drat!

kjconrad
Muffin
Posts: 30
Joined: Sat Jul 18, 2009 5:41 am

Re: Prowl notifications for Google Voice

Postby kjconrad » Wed Aug 12, 2009 4:28 am

At least I know I'm not alone... Now instead of the script looking like it's works I'm getting this error message:

Code: Select all

Traceback (most recent call last):
  File "prowlgooglevoice.py", line 63, in <module>
    gv.check()
  File "/Users/XXXXXX/gvpython/googlevoicenotify.py", line 100, in check
    feed = self.get_inbox()
  File "/Users/XXXXX/gvpython/googlevoicenotify.py", line 67, in get_inbox
    return str(sp.response.html.contents[0])
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2122' in position 83525: ordinal not in range(128)

This is a bummer :(

mmuyskens
Harmless
Posts: 2
Joined: Wed Aug 12, 2009 1:40 am

Re: Prowl notifications for Google Voice

Postby mmuyskens » Wed Aug 12, 2009 4:39 am

Emailed Mike earlier about this.

He confirmed something changed on Google's side and that he would be working on fixing this.

kjconrad
Muffin
Posts: 30
Joined: Sat Jul 18, 2009 5:41 am

Re: Prowl notifications for Google Voice

Postby kjconrad » Wed Aug 12, 2009 4:43 am

mmuyskens wrote:Emailed Mike earlier about this.

He confirmed something changed on Google's side and that he would be working on fixing this.


Yay! MikeK you are the best!

hot_damn
Harmless
Posts: 6
Joined: Mon Aug 03, 2009 5:45 am

Re: Prowl notifications for Google Voice

Postby hot_damn » Wed Aug 12, 2009 5:01 am

thank you thank you! I really appreciate all the hard work you've put in for the benefit of the community. It almostakes me want to learn python. Almost.

atomjack
Harmless
Posts: 6
Joined: Wed Aug 12, 2009 6:03 pm

Re: Prowl notifications for Google Voice

Postby atomjack » Wed Aug 12, 2009 6:16 pm

Big thanks to Mike for his work on this. I too wasn't able to get the script to notify any of the sms's, so I delved into the scripts and found the problem.

On line 76 of googlevoicenotify.py, change it from:

Code: Select all

sms = sp.findAll('div', attrs={'class':'gc-message gc-message-sms'})

to

Code: Select all

sms = sp.findAll('div', attrs={'class':'goog-flat-button gc-message gc-message-sms'})



Now it's working pretty great. Texts from contacts that are in my google address book show up as their name instead of their number. I've come across one problem though, where if you rerun the script without marking the sms('s) read in google voice, it re-pushes the sms('s) to you. It seems this would make having the script run as a cron be problematic...I don't really know python so I don't think I could really contribute to fix that, unfortunately.

Again, thanks Mike!

mmuyskens
Harmless
Posts: 2
Joined: Wed Aug 12, 2009 1:40 am

Re: Prowl notifications for Google Voice

Postby mmuyskens » Wed Aug 12, 2009 7:03 pm

Jack dudeeeeee, if I was gay I would love you.


Thanks for the fix!


Return to “Prowl”

Who is online

Users browsing this forum: No registered users