Prowl notifications for Google Voice

An iPhone client for Growl available on the App Store.
jonfulk
Harmless
Posts: 3
Joined: Tue Aug 25, 2009 10:03 pm

Re: Prowl notifications for Google Voice

Postby jonfulk » Tue Aug 25, 2009 10:12 pm

you guys are really great! i've gone from having never used python to ALMOST getting this to work. i hope you can help... here is my problem:

i'm on a linux shared server hosted on godaddy.com. since i can't install the dependencies on the shared server, i'm using virtual python (per Seth's excellent instructions). apparently, my server only has python 2.4 installed, so i ran into some problems with importing defaultdict from collections. i came across a fix for that at: http://code.activestate.com/recipes/523034/ which emulates this. (i edited this script a bit though per one of the comments on that page, changing self.items to self.iteritems)

after doing all that i've actually gotten the script to work...once - it sends all the messages in my inbox to my ipod touch at once, but then it throws an error and dies. i'm running into pickling problems, and i'm guessing this goes back to the missing defaultdict. here is the traceback:

Code: Select all

-bash-3.2$ ~/bin/python ~/html/cgi/prowlgooglevoice.py
sleeping…

Traceback (most recent call last):
File “/var/chroot/home/content/censored/html/cgi/prowlgooglevoice.py”, line 66, in ?
gv.check()
File “/home/content/censored/html/cgi/googlevoicenotify.py”, line 173, in check
pickle.dump(self.convo_threads, out_fl)
cPickle.PicklingError: Can’t pickle : attribute lookup googlevoicenotify.defaultdict failed


if you want to see what i did to googlevoicenotify with the emulation of collections.defaultdict, just let me know!

Thanks for your help!

EDIT:
Anyone know how to use Cerealizer http://home.gna.org/oomadness/en/cerealizer/index.html ? maybe if i convert to Cerealizer i won't have this problem?

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Wed Aug 26, 2009 9:21 pm

To the above post, I don't know pickle enough to figure that out quickly. Also, you're changing stuff, so that makes it harder to track, fwiw.

Also, I've been running my exception checker and I found a new exception. :) Took almost a week, but this is why I explicitly fixed the IncompleteRead (wanted to find new exceptions, and to let it break if someone doesn't have the dependencies installed). It appears URLError gets raised for a protocol error. I'm getting ready to head out, but the fix should be as simple as adding URLError to the import line used for IncompleteRead and adding that to our exceptions to catch. :) I'll post the change later tonight if I'm not busy. Error from log file:

Code: Select all

Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 152, in check
    vmfeed = self.get_voicemails()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 111, in get_voicemails
    html = self.do_req('https://www.google.com/voice/inbox/recent/voicemail/').read()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 57, in do_req
    f = req.open(url)
  File "/usr/lib/python2.5/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "/usr/lib/python2.5/urllib2.py", line 399, in _open
    '_open', req)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.5/urllib2.py", line 1082, in do_open
    raise URLError(err)
URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>


It only happened when parsing the VM stuff, but I'd catch the exception on both SMS and VM. Oh, and ignore the line numbers, my version is slightly different but not enough to change anything (comments and if Debug: print statements and such).

haninaguib
Harmless
Posts: 4
Joined: Sun Aug 16, 2009 2:14 am

Re: Prowl notifications for Google Voice

Postby haninaguib » Wed Aug 26, 2009 10:16 pm

Hi guys,

I have setup a system at http://www.gvmax.com that lets you get your Google Voice SMSs sent to your email and/or to your iPhone via Prowl. It is supposed to make the process easier (although unfortunately currently you will need to supply your GV credentials). It is more for people that don't have the know how, dont want to keep a machine running 24hrs/day or just dont have the time to setup the scripts mentioned in this forum.

It is currently very much in beta stage but barring any unexpected bugs it should do the job.

I will be releasing a standalone opensource version in the future for those that want to run it on their own servers.

Let me know what you think.

jonfulk
Harmless
Posts: 3
Joined: Tue Aug 25, 2009 10:03 pm

Re: Prowl notifications for Google Voice

Postby jonfulk » Thu Aug 27, 2009 2:03 am

I have setup a system at http://www.gvmax.com that lets you get your Google Voice SMSs sent to your email and/or to your iPhone via Prowl. It is supposed to make the process easier (although unfortunately currently you will need to supply your GV credentials). It is more for people that don't have the know how, dont want to keep a machine running 24hrs/day or just dont have the time to setup the scripts mentioned in this forum.


Thanks! Nice little service. :D

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Thu Aug 27, 2009 4:05 am

The idea of having a 3rd party server serving up this service would be nice, but

1. Not sure how comfortable I would personally feel about giving up my Google account's credentials to a 3rd party server from some random guy ;)
2. Not sure what the intervals are, but for SMS to even be useful, you need something fairly quick as far as intervals go. I use 15 seconds personally. I may drop it to 10 seconds at some point.

I personally have 3 personal servers that run 24/7 for various reasons (home storage, website, testing) so running a script myself in Python is no biggie. Also, I'd add SSL to your page for the login credentials.

jonfulk
Harmless
Posts: 3
Joined: Tue Aug 25, 2009 10:03 pm

Re: Prowl notifications for Google Voice

Postby jonfulk » Thu Aug 27, 2009 6:18 am

1. Not sure how comfortable I would personally feel about giving up my Google account's credentials to a 3rd party server from some random guy ;)


yeah i had a hard time coming to the decision, but i decided i could always change my password and reset the prowl api if i needed to.

2. Not sure what the intervals are, but for SMS to even be useful, you need something fairly quick as far as intervals go. I use 15 seconds personally. I may drop it to 10 seconds at some point.


it checks about every minute, which is fast enough for me. i've checked it out a little, and it's got nice response time. i don't think it will hurt if people have to wait a minute at the most before i get their message. i'm not getting tons of text messages anyway.

i would really like to get the python script running on my server, but until someone else has the same problems as me, i'm going to have to assume it won't work on a godaddy shared server. since i'm too cheap to pay for a better server, i decided to go this route.

haninaguib
Harmless
Posts: 4
Joined: Sun Aug 16, 2009 2:14 am

Re: Prowl notifications for Google Voice

Postby haninaguib » Thu Aug 27, 2009 7:21 am

tsuehpsyde wrote:The idea of having a 3rd party server serving up this service would be nice, but

1. Not sure how comfortable I would personally feel about giving up my Google account's credentials to a 3rd party server from some random guy ;)
2. Not sure what the intervals are, but for SMS to even be useful, you need something fairly quick as far as intervals go. I use 15 seconds personally. I may drop it to 10 seconds at some point.

I personally have 3 personal servers that run 24/7 for various reasons (home storage, website, testing) so running a script myself in Python is no biggie. Also, I'd add SSL to your page for the login credentials.


All valid points.

GVMax actually runs on Google's AppEngine :) so the data is securely stored in Google's Datastore additionally it is encrypted and none of the pages ever display your password or messages. Your point about SSL is valid
(unfortunately AppEngine does not support SSL on custom domains so I will have to go with its appengine url ( https://gvmax-at.appspot.com/ ) *which is already working. I will need to get gvmax.com to redirect to this
url until AppEngine starts supporting SSL on custom domains.

As Jon mentioned the server checks emails once a minute, this was sort of an arbitrary choice, but I think for most people that is more than enough.

That leaves the random guy :) That is out of my hands people will have to make their own mind.

For someone like you it does not make much sense to use GVMax, you have the servers and the know-how. But for a lot of people installing scripts and running servers is just not a real option.
In fact I created GVMax specifically with non-tech type people in mind and have tried hard to make it as simple to use as possible. Even so, I suspect that the setting up of Prowl notifications
will be hard on some users.

Cheers,
Hani

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Sat Aug 29, 2009 10:00 pm

fwiw, these are the other reasons URLError is getting raised:

Code: Select all

    raise URLError(err)
URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>
    raise URLError(err)
URLError: <urlopen error (110, 'Connection timed out')>
    raise URLError(err)
URLError: <urlopen error (-2, 'Name or service not known')>
    raise URLError(err)
URLError: <urlopen error (-2, 'Name or service not known')>
    raise URLError(err)
URLError: <urlopen error (-2, 'Name or service not known')>
    raise URLError(err)
URLError: <urlopen error (-2, 'Name or service not known')>
    raise URLError(err)
URLError: <urlopen error (110, 'Connection timed out')>


I'm testing a fix right now. :) Once I've made sure it catches the exception as expected (we're already importing urllib2, which is where URLError is at), I'll send a diff to Mike. This is what I'm testing now:

Code: Select all

72c72
<               except IncompleteRead, e:
---
>               except (IncompleteRead, URLError), e:
115c115
<               except IncompleteRead, e:
---
>               except (IncompleteRead, URLError), e:


Edit: switched URLError to urllib2.URLError. =) Trying that now...

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Tue Sep 01, 2009 10:32 pm

Emailed the diff to Mike as it appears to be working as expected. :) Hopefully now the intermittent crashes are now toast.

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Tue Sep 08, 2009 5:02 am

I found yet another exception based on bad input coming over the 'net. :( Posting exception here:

Code: Select all

Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 152, in check
    vmfeed = self.get_voicemails()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 111, in get_voicemails
    html = self.do_req('https://www.google.com/voice/inbox/recent/voicemail/').read()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 57, in do_req
    f = req.open(url)
  File "/usr/lib/python2.6/urllib2.py", line 383, in open
    response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 401, in _open
    '_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 361, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1138, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.6/urllib2.py", line 1103, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 950, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 390, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 354, in _read_status
    raise BadStatusLine(line)
BadStatusLine


I have the built-in exception checker and logger I posted earlier, so it's not breaking anything for me. It took running for a over a week without fail to finally find this one, and it just happened about an hour ago. :P Like before, even though the list is growing, I think adding each one individually is better. However, if Mike decides tracking these sucks, a blanket except: can be used too. I'll fix this tomorrow and post up another diff when I get around to it.

jemler
Harmless
Posts: 2
Joined: Thu Sep 10, 2009 1:53 pm

Re: Prowl notifications for Google Voice

Postby jemler » Thu Sep 10, 2009 5:49 pm

tsuehpsyde wrote:I found yet another exception based on bad input coming over the 'net. :( Posting exception here:
...


Thanks for your exception catching additions to the code tsuehpsyde.
I have some more exceptions for you, i'm running the script on a mac over a wifi connection. Could you add these too?

Code: Select all

urllib2.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
urllib2.URLError: <urlopen error [Errno 8] _ssl.c:480: EOF occurred in violation of protocol>
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>


I'm a total python noob, otherwise i'd do it myself ;)
thanks!

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Fri Sep 11, 2009 2:36 pm

The error you've posted I've already submitted to Mike. :) It's the urllib2.URLError (see the diff I posted). So yeah, that's already caught, and is the main exception I've seen failing. Thanks for the info, though.

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

Re: Prowl notifications for Google Voice

Postby kjconrad » Sat Sep 19, 2009 4:54 pm

Since Mike doesn't seem to be putting your updates into his script... is it possible for you to post the code here with instructions for people who aren't very python savy (Like Myself)

IE: Take this code and paste it in at line ##

Thanks :)

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Sun Sep 20, 2009 4:39 am

kjconrad wrote:Since Mike doesn't seem to be putting your updates into his script... is it possible for you to post the code here with instructions for people who aren't very python savy (Like Myself)

IE: Take this code and paste it in at line ##

Thanks :)


I assume he's a busy guy. But the error you're seeing is already posted with a fix. If you want to apply it, simply copy/paste the text I posted in a file and use patch to patch it into the file (assuming you're on a Linux system, not sure about other platforms).

I sent Mike a nudge via GTalk. If he doesn't put in the fixes, I'll just fix the code up and post up a link. :) I'd rather get the fixes into his repo than either branch it or post my own versions, but we'll see.

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

Re: Prowl notifications for Google Voice

Postby kjconrad » Sun Sep 20, 2009 4:57 am

tsuehpsyde wrote:I assume he's a busy guy. But the error you're seeing is already posted with a fix. If you want to apply it, simply copy/paste the text I posted in a file and use patch to patch it into the file (assuming you're on a Linux system, not sure about other platforms).

I sent Mike a nudge via GTalk. If he doesn't put in the fixes, I'll just fix the code up and post up a link. :) I'd rather get the fixes into his repo than either branch it or post my own versions, but we'll see.


Oh yeah, I'm sure he is a busy guy, no disrespect intended. I'm just a very green novice and was hoping for a quick bit of help :)

I'm not on Linux, I'm on OS X, I'm not sure what patch is or how to use it. You posted 3 bits of code in 2 different post, is it as easy as copying and pasting that into the google voice script? Would it go in googlevoicenotify.py or prowlgooglevoice.py? Does it have to be put at a certain line, or can I just paste it in anywhere?

On another note, has anyone noticed if you get a blank text message it freaks this script out? I don't know how often people would get a blank text message, but I have a friend with a malfunctioning phone, got 2 today and had to restart the script each time.

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Tue Sep 22, 2009 5:27 pm

FYI, I contacted him and he's busy, but putting in my fixes are on his radar. :) So no worries.

Also noting, I found a new error. A nasty one, it would seem. I was testing out my GV voicemail and was showing someone, but it didn't ping me. I loaded up SSH and checked my server and my log file was 559MB! :!: Something had faulted and it was continuously failing over and over and over.

Here's the error:

Code: Select all

Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'
Traceback (most recent call last):
  File "./prowlgooglevoice.py", line 73, in <module>
    gv.check()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 147, in check
    feed = self.get_inbox()
  File "/home/tsuehpsyde/bin/prowl-gv/googlevoicenotify.py", line 70, in get_inbox
    return str(sp.response.html.contents[0])
AttributeError: 'NoneType' object has no attribute 'html'


The error was in a continuous loop. I dunno for how long, but 560MB worth of logging long. I need to add time-stamping to the actual log file to get a better idea for the future. In the screen itself though, it has this:

Code: Select all

New Exception: Tue Sep 22 12:17:25 2009
New Exception: Tue Sep 22 12:17:25 2009
New Exception: Tue Sep 22 12:17:26 2009
New Exception: Tue Sep 22 12:17:26 2009
New Exception: Tue Sep 22 12:17:27 2009
New Exception: Tue Sep 22 12:17:27 2009
New Exception: Tue Sep 22 12:17:28 2009
New Exception: Tue Sep 22 12:17:28 2009
New Exception: Tue Sep 22 12:17:29 2009
New Exception: Tue Sep 22 12:17:29 2009
New Exception: Tue Sep 22 12:17:30 2009
New Exception: Tue Sep 22 12:17:30 2009
New Exception: Tue Sep 22 12:17:31 2009
New Exception: Tue Sep 22 12:17:31 2009
New Exception: Tue Sep 22 12:17:32 2009
New Exception: Tue Sep 22 12:17:32 2009


Again, that's the exception code I posted and am running personally, not the official code. The screen's buffer only goes to Tue Sep 22 11:32:19 2009 so I have no way of knowing. I could start redirecting the output to a file as well.

Either way, I still need to post a fix for the other error before this one. I just keep posting bugs here for reference. :)

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

Re: Prowl notifications for Google Voice

Postby kjconrad » Wed Sep 23, 2009 1:40 pm

well... I guess uh, ok

I wasn't wanting you to bug Mike... I was hoping you could share your fixes w/ instructions easy enough for a novice to follow. I guess I'll wait on Mike to update then since that doesn't seem possible for whatever reason. Sorry, not trying to be a jerk. I do appreciate your work into fixing stuff.

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Fri Sep 25, 2009 4:56 pm

Well, I didn't want to post it up since I was trying to keep the confusion down so Mike can deal it out.

That, and I use my own hacked up version of this script as I fix bugs as they come up.

Still, per your request, I've went ahead and incorporated my changes here:

http://www.tsuehpsyde.com/googlevoicenotify.tar.bz2

There are three files on there:

googlevoicenotify.py <---original you can download now
googlevoicenotify.py.diff <---the diff between the two
googlevoicenotify.py.tsue <---modified with my fixes

Just rename the .tsue version to just .py and it should serve your needs. I just downloaded the latest version, found my fixes and re-implemented them by hand, just for you. ;) Also switched it out into my own script to make sure it works (it does), just missing some of the verbosity I added myself. But there were a few changes made that I didn't have, so I added those.

Hope it works for ya. I included the diff for Mike as well.

rathkopf
Harmless
Posts: 4
Joined: Fri Sep 25, 2009 5:33 pm

Re: Prowl notifications for Google Voice

Postby rathkopf » Fri Sep 25, 2009 7:00 pm

tsuehpsyde,

Do you latest patches actually work? You may not have the big log file any more, but have you checked to see if you are actually retrieving the SMS messages?

I did a little debugging and found that the root of the problem is that the google login is failing. Print out the result of the login POST and you'll see that it's another login screen. Your patch fixes there symptom, but doesn't fix the problem.

In the new login screen after the failed login, there's a hidden GALX value that it is expecting in the new POST. I extracted that value an stuck it in in a new POST, and was able to proceed without crashing, even without your patch. Then a SMS from yesterday popped up on my phone.

My python is a little rusty, and I'm sure there's got to be a cleaner way to do this, but here's my fix:

Code: Select all

*** googlevoicenotify.py.orig   2009-09-25 10:57:09.000000000 -0800
--- googlevoicenotify.py        2009-09-25 10:56:53.000000000 -0800
***************
*** 61,67 ****
                if len(self.cookies) == 0:
                         # first do the login POST
                        login = self.do_req('https://www.google.com/accounts/ServiceLoginBoxAuth?Email=%s&Passwd=%s&service=grandcentral' % (self.username, self.password)).read()
!                        # second step is to pass the cookie check
                        cookie_check = self.do_req('https://www.google.com/accounts/CheckCookie?chtml=LoginDoneHtml').read()
               
                try:
--- 61,78 ----
                if len(self.cookies) == 0:
                         # first do the login POST
                        login = self.do_req('https://www.google.com/accounts/ServiceLoginBoxAuth?Email=%s&Passwd=%s&service=grandcentral' % (self.username, self.password)).read()
!
!
!
!                       # second step is to login again with the GALX value
!                       # extracted from the first attempt
!                       galxindex = login.find("GALX")
!                       galxindex = login.find("value=",galxindex);
!                       galx = login[galxindex+7:galxindex+18]
!                       
!                       login = self.do_req('https://www.google.com/accounts/ServiceLoginBoxAuth?Email=%s&Passwd=%s&service=grandcentral&GALX=%s' % (self.username, self.password, galx)).read()
!
!                        # third step is to pass the cookie check
                        cookie_check = self.do_req('https://www.google.com/accounts/CheckCookie?chtml=LoginDoneHtml').read()
               
                try:

tsuehpsyde
Harmless
Posts: 18
Joined: Tue Aug 18, 2009 1:32 am

Re: Prowl notifications for Google Voice

Postby tsuehpsyde » Fri Sep 25, 2009 8:12 pm

I sent my GV # an SMS after using the file I gave you. Worked just fine for me? Not sure what's up.

SMS: MYnAME said MYNAME - Testing new library


Return to “Prowl”

Who is online

Users browsing this forum: No registered users