-
Notifications
You must be signed in to change notification settings - Fork 0
/
PyFacts.py
65 lines (60 loc) · 2.04 KB
/
PyFacts.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from googlevoice import Voice,util,settings
from googlevoice.util import input
from random import randint
import time
# import voice/lists
voice = Voice()
voice.login()
with open("num_cat.db") as f:
nums_cat = f.readlines()
with open("num_pok.db") as f:
nums_pok = f.readlines()
with open("num_gir.db") as f:
nums_gir = f.readlines()
with open("cat.db") as f:
fax_cat = f.readlines()
with open("pokemon.db") as f:
fax_pok = f.readlines()
with open("giraffe.db") as f:
fax_gir = f.readlines()
# Send the list a random fact each
def daily():
for i in range(0,len(nums_cat)-1):
voice.send_sms(nums_cat[i],fax_cat[randint(0,len(fax_cat)-1)])
time.sleep(10)
for i in range(0,len(nums_pok)-1):
voice.send_sms(nums_pok[i],fax_pok[randint(0,len(fax_pok)-1)])
time.sleep(10)
for i in range(0,len(nums_gir)-1):
voice.send_sms(nums_gir[i],fax_gir[randint(0,len(fax_gir)-1)])
time.sleep(10)
# Check inbox, respond to unread messages
def checkInbox():
for message in voice.sms().messages:
if not message.isRead:
n = message.phoneNumber
message.mark()
if str(n) in str(nums_cat): # if in cat list
voice.send_sms(n,fax_cat[randint(0,len(fax_cat)-1)])
if str(n) in str(nums_pok): # if in pokemon list
voice.send_sms(n,fax_pok[randint(0,len(fax_pok)-1)])
if str(n) in str(nums_gir): # if in giraffe list
voice.send_sms(n,fax_gir[randint(0,len(fax_gir)-1)])
if not str(n) in str(nums_cat) and not str(n) in str(nums_pok) and not str(n) in str(nums_gir) and not str(n) in str(nums_sex): # if in no list, default to cat
voice.send_sms(n,fax_cat[randint(0,len(fax_cat)-1)])
time.sleep(10)
def main():
perdiem = 6.0 # facts/day for daily
start = 86400.0/perdiem
sinDay = start
s = 10 # Sleep incrimentor (s)
daily()
while True:
if sinDay < 100:
daily() # Send fact perdiem/day to number list
sinDay = start
time.sleep(s)
sinDay = sinDay-s
checkInbox()
if __name__ == "__main__":
main()