python - Google PR 查询接口URL校验码算法求解!
怪我咯
怪我咯 2017-04-17 11:33:48
0
0
720

最新的GooglePR查询接口:http://toolbarqueries.google.com/tbr?client=navclient-auto&ch={gchecksum}&features=Rank&q=info:{url|encode}

下面是Python的gchecksum(&ch)算法,看着晕乎乎的,求指导。

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

def google_hash(value):
    magic = 0x1020345
    for i in xrange(len(value)):
        magic ^= ord(GPR_HASH_SEED[i % len(GPR_HASH_SEED)]) ^ ord(value[i])
        magic = (magic >> 23 | magic << 9) & 0xFFFFFFFF
    return "8%08x" % (magic)

出处链接:http://james.slaterspage.com/scraping-google-related-with-bonus-pagerank/

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template