検索

ホームページ  >  に質問  >  本文

python - Google PR 查询接口URL校验码算法求解!

最新的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/

怪我咯怪我咯2784日前714

全員に返信(0)返信します

応答なし
  • キャンセル返事