forked from rndinfosecguy/Scavenger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stalk_user.py
33 lines (29 loc) · 905 Bytes
/
stalk_user.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
import tweepy
import time
import os
class MyStreamListener(tweepy.StreamListener):
def on_status(self, status):
with open("stalking.txt", "a") as myfile:
if "RT " not in status.text:
print(status.text)
myfile.write(status.text + "\n")
link = status.text.split(" ")
for l in link:
if "https://" in l:
os.system("wget -O dumps/" + str(time.time()) + " " + l)
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
access_secret = ""
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
myStreamListener = MyStreamListener()
myStream = tweepy.Stream(auth = api.auth, listener=myStreamListener)
try:
# Get the ID of a twitter user https://tweeterid.com/
myStream.filter(follow=["<TWITTER-USER-ID-U-WANT-TO-STALK>"])
except:
pass