summaryrefslogtreecommitdiffstats
path: root/searchtwit.py
blob: 55b3206bab6416ae552e0696f5ed603087617443 (plain)
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
#!/usr/bin/python2
import twitter
import sys

term=str(sys.argv[1])

if len(sys.argv) > 2:
    passw = str(sys.argv[2])
else:
    passw = None
api= twitter.Api(username='emptyvacuum', password=passw)
user="emptyvacuum"
import re
import sys
import time

statuses= api.GetUserTimeline(user)

list=[s.text for s in statuses]

#print list
linkpos=None
matches=[]

if term == "all":
    print list
    exit()


for text in list:
    if re.match("^.*"+term+".*$",text):
            matches.append(text)

print matches