-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathcodezero.2.py
60 lines (47 loc) · 1.41 KB
/
codezero.2.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
#Fuck ISIS
#We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us
#Title: Twitter follower scanner
#Details:It is a script to generate a list of the targets followers
#Author: codezero
#Version: 0.02 BETA
import requests
from bs4 import BeautifulSoup
i=0
followers = 'followers.txt'
ffollowers = open(followers,'w')
user = "myconfusedface";
def getlink(username,pageid):
if pageid == "null":
page = requests.get("https://mobile.twitter.com/"+username+"/followers")
else:
page = requests.get("https://mobile.twitter.com/"+username+"/followers?cursor="+pageid)
soup = BeautifulSoup(page.content, 'html.parser')
getfollowers(soup)
link = soup.find("a", string="Show more people")
if not link:
return "End"
link = str(link)
link = link.split('r=')
link = link[1].split('\">')
return link[0]
def getfollowers(soup):
#print(soup)
username = soup.find_all("span", class_="username")
for username in username:
username = str(username)
username = username.split('</span>')
username = username[1]
#print(username)
ffollowers.write(username+"\n")
return 0
pid = getlink(user,"null")
try:
while 1:
i +=1
print("Page " + str(i))
pid = getlink(user,pid)
if pid == "End":
ffollowers.close()
break
except KeyboardInterrupt:
print 'interrupted!'