Google PR checksum
Posted: Wed Mar 21, 2007 12:37 am
Hello,
I am intrested to make a google PR checker.
It seems you have to encode your requested URL and only then you will get the PR of the page.
It is called google checksum, and it is included in the HTTP GET protocol request.
so i searched the net and found a javaScript and C# codes
But i am not an expert programmer and even few lines of code including Hex and bit shifting can make the code tottaly weird for me.
here are the codes
Java Script
C#
All this is taken from http://www.webmasterwords.com/google-pa ... cksum-in-c
Apperciate help in converting it to PB!
Thanks for your time people!
I am intrested to make a google PR checker.
It seems you have to encode your requested URL and only then you will get the PR of the page.
It is called google checksum, and it is included in the HTTP GET protocol request.
so i searched the net and found a javaScript and C# codes
But i am not an expert programmer and even few lines of code including Hex and bit shifting can make the code tottaly weird for me.
here are the codes
Java Script
Code: Select all
var GPR_HASH_SEED = “Mining PageRank is AGAINST GOOGLE’S TERMS OF SERVICE. Yes, I’m talking to you, scammer.”;
var hash = “8″ + GPR_awesomeHash(page);
function GPR_awesomeHash(value) {
var kindOfThingAnIdiotWouldHaveOnHisLuggage = 16909125;
for(var i = 0;i < value.length;i ++ ) {
kindOfThingAnIdiotWouldHaveOnHisLuggage ^= GPR_HASH_SEED.charCodeAt(i % GPR_HASH_SEED.length) ^ value.charCodeAt(i);
kindOfThingAnIdiotWouldHaveOnHisLuggage = kindOfThingAnIdiotWouldHaveOnHisLuggage >>> 23 | kindOfThingAnIdiotWouldHaveOnHisLuggage << 9}
return GPR_hexEncodeU32(kindOfThingAnIdiotWouldHaveOnHisLuggage)}
function GPR_hexEncodeU32(num) {
var result = GPR_toHex8(num >>> 24);
result += GPR_toHex8(num >>> 16 & 255);
result += GPR_toHex8(num >>> 8 & 255);
return result + GPR_toHex8(num & 255)}
function GPR_toHex8(num) {
return(num < 16 ? "0" : "") + num.toString(16)}
Code: Select all
public class pagerank
{
private string toHex8(uint num)
{
if(num<16) return "0"+String.Format("{0:x}",num);
else return String.Format(”{0:x}”,num);
}
public string calculateChecksum(string url)
{
string stupidGoogleHash = “Mining PageRank is AGAINST GOOGLE’S TERMS OF SERVICE. Yes, I’m talking to you, scammer.”;
uint key = 16909125;
for(int i=0; i < url.Length; i++) {
key = (uint)key ^ (uint)(stupidGoogleHash[i%stupidGoogleHash.Length])^(uint)(url[i]);
key = key>>23|key<<9;
}return “8″+toHex8(key>>(8&255))+toHex8(key&255);
}
}
Apperciate help in converting it to PB!
Thanks for your time people!