forked from jokerjarg/pagerank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprank.py
More file actions
48 lines (46 loc) · 991 Bytes
/
Copy pathprank.py
File metadata and controls
48 lines (46 loc) · 991 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
41
42
43
44
45
46
47
48
import re
import sys
import pagerank
# coded by : jok3r, mass google pagerank checking
# jarg1.wordpress.com, jokerjarg@gmail.com
if(len(sys.argv) < 2):
print "[*] Usage : python prank.py sites.txt"
sys.exit()
websites = []
ranked = []
highranks = []
try:
sites=open(sys.argv[1],"r").readlines()
except IOError:
print " [-] Error Loading the List!"
sys.exit()
def add(site):
for website in websites:
if site == website:
return False
return True
def highRank(rank):
if int(rank) >= 4:
return True
else:
return False
for s in sites :
s = s.replace("\n","")
if(add(s) == True):
websites.append(s)
else:
print s, " exists "
print " ***results**** "
for website in websites:
res = pagerank.GetPageRank(website)
ranked.append(website+" : "+res)
if(highRank(res) == True):
highranks.append(website+" : "+res)
print "Results : "
for r in ranked:
r = r.replace("\n","")
print r
print "\nHigh Ranks :"
for h in highranks:
h = h.replace("\n","")
print h