-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathç
40 lines (27 loc) · 771 Bytes
/
ç
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
import tweepy
import json
from time import sleep
from credentials import *
from keywords import *
from classes.tuit import Tuit
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
#data = api.search(q='AyudaCDMX',
# result_type="recent")
# print(data[1])
tuits = []
counter = 0
while counter < 1:
data = api.search(q='AyudaCDMX',
result_type="recent")
for d in data:
tuits.append(Tuit(d.author.screen_name, d.text))
counter += 1
#for t in tuits:
# print(t.toString())
for t in tuits:
for kw in kws:
if t.getText().lower().find(kw) != -1:
#print(t.getText().lower())
print(t.toString())