-
Notifications
You must be signed in to change notification settings - Fork 12
/
README
47 lines (32 loc) · 1.92 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
GoogleVoiceNotify polls the Google Voice XML pages (http://posttopic.com/topic/google-voice-add-on-development), and sends notifications to any number of registered listeners.
At the moment, the Notifier only supports SMS notifications, but adding voicemail, missed calls, etc, is just a matter of writing scrapers for those as well.
Requires:
1. BeautifulSoup (http://www.crummy.com/software/BeautifulSoup/)
2. prowlpy (http://github.com/jacobb/prowlpy/tree/master) (which also has its own dependencies such as httplib2)
I've also included a sample client for GoogleVoiceNotify that sends notifications to Prowl (http://prowl.weks.net/), which sends iPhone push notifications.
To use the Prowl listener, you need to create two files in your home directory.
~/.prowlapi (should just contain your Prowl API key)
(optionally) ~/.gvnotify (a config file that should look as follows):
gvid=yourusername
password=yourpassword
sleep=sleeptime (in seconds)
If you don't make a credentials file, then the prowlgooglevoice.py script will prompt you for a username/password on the command line and default to 60 seconds.
then just do:
python prowlgooglevoice.py
in the same folder where the prowlgooglevoice.py, googlevoicenotify.py files are.
I've also included a bash script that launches/controls the notifier, written by James Bair (in tools/prowl-gv.sh) and a Python daemon written by Brian Baughman (in tools/gv2prowldaemon.py)
Usage:
from googlevoicenotify import GoogleVoiceNotify
gv = GoogleVoiceNotify('username', 'password')
gv.check()
Though you'll probably want to register at least one listener:
class PrintListener(object):
def on_notification(self, event, name, message):
print "(%s) %s said %s" % (event, name, message)
from googlevoicenotify import GoogleVoiceNotify
import time
print_listener = PrintListener()
gv = GoogleVoiceNotify('your_username', 'your_password', listeners=print_listener)
while True:
gv.check()
time.sleep(60)