PR checker in python.

dr_0x

Regular Member
Joined
May 9, 2010
Messages
307
Reaction score
266
Here is how you can check your PR in python.

Code:
import httplib

def HashURL (url):
    SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."
    Result = 0x01020345
    for i in range(len(url)) :
        Result ^= ord(SEED[i%len(SEED)]) ^ ord(url[i])
        Result = Result >> 23 | Result << 9
        Result &= 0xffffffff
    return '8%x' % Result

def get(url):
    url = url.strip("\a\b\f\n\r\t\v")
    conn = httplib.HTTPConnection('www.google.com')
    googleurl = '/search?client=navclient-auto&features=Rank:&q=info:' \
        + url + '&ch=' + HashURL(url)
    conn.request("GET", googleurl)
    response = conn.getresponse()
    data = response.read()
    status = response.status
    conn.close()
    pr = data.split(":")[-1].strip('\n')
    if len(pr) == 0 or status != 200:
        pr = '-1'
    return pr

Cheers! :D
 
Is there an addon for this that I can integrate into my browser? How can I use this code as I don't know how to code?
 
Why do you have this line of code:

SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."
 
yep. The code works. Thanks.
I checked PRs more than 1000 sites, works fine.
 
Is there an addon for this that I can integrate into my browser? How can I use this code as I don't know how to code?

Download python installer from python.org/download/ and run this script with python.exe
 
Why do you have this line of code:

SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."

This is what G**gle uses to salt the the hash of the url that gets sent to their server, without it the hash would be invalid.
 
Last edited:
Back
Top