-
Notifications
You must be signed in to change notification settings - Fork 3
/
sms
executable file
·43 lines (33 loc) · 1.11 KB
/
sms
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
#!/usr/bin/env python
# The fixed pygooglevoice Python binding are required to use this script:
#
# cd software
# git clone git@github.com:pettazz/pygooglevoice.git
# cd pygooglevoice
# python setup.py install
from googlevoice import Voice
from googlevoice.util import input
import re
from optparse import OptionParser
def main():
parser = OptionParser()
parser.add_option("-n", dest="phoneNumber",
help="phone number")
parser.add_option("-m", dest="message",
help="text of message")
parser.add_option("-p", dest="password", default="",
help="Google Voice password")
parser.add_option("-v", action="store_true", dest="verbose", default=False,
help="verbose mode")
(options, args) = parser.parse_args()
voice = Voice()
if (options.password == ""):
voice.login()
else:
voice.login(passwd=options.password)
if options.verbose:
print "Sending msg to %s: '%s'" % (options.phoneNumber, options.message)
voice.send_sms(options.phoneNumber, options.message)
voice.logout()
if __name__ == "__main__":
main()