PR checker in python.

Discussion in 'Black Hat SEO' started by dr_0x, Aug 14, 2011.

  1. dr_0x

    dr_0x Jr. VIP Jr. VIP

    Joined:
    May 9, 2010
    Messages:
    307
    Likes Received:
    256
    Home Page:
    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
     
    • Thanks Thanks x 1
  2. VIC SEO

    VIC SEO Elite Member

    Joined:
    Feb 19, 2010
    Messages:
    2,165
    Likes Received:
    365
    Gender:
    Male
    Occupation:
    SEO Specialist
    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?
     
  3. johndea

    johndea Regular Member

    Joined:
    Jun 23, 2011
    Messages:
    308
    Likes Received:
    35
    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."
     
  4. wu1239

    wu1239 Newbie

    Joined:
    Jun 4, 2011
    Messages:
    16
    Likes Received:
    0
    yep. The code works. Thanks.
    I checked PRs more than 1000 sites, works fine.
     
  5. EJIKK

    EJIKK Newbie

    Joined:
    Aug 2, 2011
    Messages:
    17
    Likes Received:
    0
    Download python installer from python.org/download/ and run this script with python.exe
     
  6. dr_0x

    dr_0x Jr. VIP Jr. VIP

    Joined:
    May 9, 2010
    Messages:
    307
    Likes Received:
    256
    Home Page:
    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: Aug 23, 2011