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

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

怪我咯
怪我咯

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

membalas semua(0)
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!