-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
25 lines (24 loc) · 828 Bytes
/
main.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
import tweet
import calculateur
import time
if __name__=='__main__':
print("Lancement")
api=tweet.auth()
print("Authentifié")
while True:
mention=tweet.get_mentions(api)
#mention=tweet.check_list(mention)
print([m.text for m in mention])
for tw in mention:
print(tw.text)
(quant,mult)=calculateur.find_t_co2(tw.text)
if quant==None or mult==None or quant=="":
print("ERREUR")
else:
quant=calculateur.reformat_number(quant)
texte=calculateur.calc_equiv(quant,mult)
print(texte)
tweet.publicate_response(api,"@"+(tw.user).screen_name+" "+texte,tw.id)
print("Publié")
print("Waiting... "+str(time.time()))
time.sleep(60)