Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > Miscellaneous > Lounge

Notices

Reply
 
Thread Tools Search this Thread
Old 07-19-2004, 02:50 PM   #136
Unregistered
Nameless Being
 
Could anybody translate the algorithm into vb6 ??

Could anybody translate the algorithm into vb6 ??. I ll be very gratefull
  Reply With Quote
Old 07-22-2004, 01:33 AM   #137
Unregistered
Nameless Being
 
Unhappy Help

I am trying to get this working and I am lost. I copied the finished script and saved it as a php file and it returns:

url: ch: 6882688726

Am I supposed to change a variable in the script with a different URL? I am new to php so any tips would be appreciated.
  Reply With Quote
Advert
Old 07-22-2004, 04:43 AM   #138
Colin Dunstan
Is papyrophobic!
Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.Colin Dunstan ought to be getting tired of karma fortunes by now.
 
Colin Dunstan's Avatar
 
Posts: 1,926
Karma: 1009999
Join Date: Aug 2003
Location: USA
Device: Dell Axim
The 'ch' stands for checksum.

The PageRank files can be requested directly from the domain www.google.com. Basically, the URLs for those files look like follows (without line breaks):

http://www.google.com/search?
client=navclient-auto&
ch=0123456789&
features=Rank&
q=info:http://www.domain.com/

replace 0123456789 with the checksum you receive for your site, and replace http://www.domain.com/ with your sites url you calculated the checksum for.
Colin Dunstan is offline   Reply With Quote
Old 07-22-2004, 12:09 PM   #139
Codrut
Nameless Being
 
I've read all the work you done guys here, and it is excellent. So I took the php and adapt/put it to work.
Strange things happens, as for example google turns to me a page which begins with:
Forbidden
Your client does not have permission to get URL .... etc

Do you have any idea why ?

There are many pages that gives me that response, one example is www.addidas.3x.ro

May thanks, Codrut
  Reply With Quote
Old 07-22-2004, 01:27 PM   #140
Unregistered
Nameless Being
 
Yah, if I go to that URL with my browser I get the same error. Is the script supposed to request that URL? How do I get it to return the actual Page Rank like the page here?

http://www.zenitram.th4y.com/pagerank
  Reply With Quote
Advert
Old 07-22-2004, 07:24 PM   #141
Ghank
Nameless Being
 
Got it working! I modified the script to check the PR of my links database. But I found a problem, When the URL includes a plus sign (+), it returns the following error: XML error: no element found at line 1

I changed the + to it's hex equivalent %2b and it does the same. Any ideas on how to fix it? Most people only want to check a domain PR, but I'd like to check individual pages some which have special characters.

Thanks to the people that put this script together!
  Reply With Quote
Old 07-23-2004, 09:24 AM   #142
Codrut
Nameless Being
 
Ghunk, can you verify www.ad4u.ro ? Is it working at you ?
I get some Forbidden message.
  Reply With Quote
Old 07-23-2004, 10:10 AM   #143
Raistlin Majere
Nameless Being
 
Complete PHP script :)

<html>
<body style="font-family:verdana;font-size:13px">
<?php
/*
This code is released unto the public domain

Raistlin Majere euclide@email.it

*/
define('GOOGLE_MAGIC', 0xE6359A60);

//unsigned shift right
function zeroFill($a, $b)
{
$z = hexdec(80000000);
if ($z & $a)
{
$a = ($a>>1);
$a &= (~$z);
$a |= 0x40000000;
$a = ($a>>($b-1));
}
else
{
$a = ($a>>$b);
}
return $a;
}


function mix($a,$b,$c) {
$a -= $b; $a -= $c; $a ^= (zeroFill($c,13));
$b -= $c; $b -= $a; $b ^= ($a<<8);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,13));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,12));
$b -= $c; $b -= $a; $b ^= ($a<<16);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,5));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
$b -= $c; $b -= $a; $b ^= ($a<<10);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,15));

return array($a,$b,$c);
}

function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) {
if(is_null($length)) {
$length = sizeof($url);
}
$a = $b = 0x9E3779B9;
$c = $init;
$k = 0;
$len = $length;
while($len >= 12) {
$a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24));
$b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24));
$c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24));
$mix = mix($a,$b,$c);
$a = $mix[0]; $b = $mix[1]; $c = $mix[2];
$k += 12;
$len -= 12;
}

$c += $length;
switch($len) /* all the case statements fall through */
{
case 11: $c+=($url[$k+10]<<24);
case 10: $c+=($url[$k+9]<<16);
case 9 : $c+=($url[$k+8]<<8);
/* the first byte of c is reserved for the length */
case 8 : $b+=($url[$k+7]<<24);
case 7 : $b+=($url[$k+6]<<16);
case 6 : $b+=($url[$k+5]<<8);
case 5 : $b+=($url[$k+4]);
case 4 : $a+=($url[$k+3]<<24);
case 3 : $a+=($url[$k+2]<<16);
case 2 : $a+=($url[$k+1]<<8);
case 1 : $a+=($url[$k+0]);
/* case 0: nothing left to add */
}
$mix = mix($a,$b,$c);
/*-------------------------------------------- report the result */
return $mix[2];
}

//converts a string into an array of integers containing the numeric value of the char
function strord($string) {
for($i=0;$i<strlen($string);$i++) {
$result[$i] = ord($string{$i});
}
return $result;
}

function get_pr($url) {
$result=array("",-1);

if (($url.""!="")&&($url.""!="http://")):
// check for protocol
if (substr(strtolower($url),0,7)!="http://"):
$url="http://".$url;
endif;

$url="info:".$url;
$checksum=GoogleCH(strord($url));
$google_url=sprintf("http://www.google.com/search?client=navclient-auto&ch=6%u&features=Rank&q=".$url,$checksum); // url to get from google

$contents="";
// let's get ranking
// this way could cause problems because the Browser Useragent is not set...
if ($handle=fopen($google_url,"rb")):
while(true):
$data=fread($handle,8192);
if (strlen($data)==0):
break;
endif;
$contents.=$data;
endwhile;
fclose($handle);
else:
$contents="Connection unavailable";
endif;

$result[0]=$contents;
// Rank_1:1:0 = 0
// Rank_1:1:5 = 5
// Rank_1:1:9 = 9
// Rank_1:2:10 = 10 etc
$p=explode(":",$contents);
if (isset($p[2])):
$result[1]=$p[2];
endif;
endif;

return $result;
}

// GET IT !
$pr=get_pr($_GET["url"]);
$output=$pr[0];
$pagerank=$pr[1];
?>
<br>
<form method="get" action="?r=<?=time()?>">
<center>
<table style="font-family:verdana;font-size:13px">
<tr>
<td valign="top"><b>Url</b></td>
<td valign="top"><?=$_GET['url']?></td>
</tr>
<tr>
<td valign="top"><b>Page<br>Rank</b></td>
<td valign="top" style="color:red"><b><?=$pagerank?></b></td>
</tr>
<tr>
<td valign="top"><b>Google<br>output</b></td>
<td valign="top"><div style="overflow:auto;width:250px;height:150px;back ground-color:#eeeeee;border:1px solid #aaaaaa"><?=$output?></div></td>
</tr>
</table>

<br>

<input type="text" name="url" size="80" value="<?=isset($_GET['url'])?$_GET['url']:"http://"?>"><br>
<input type="submit">

</center>
</form>
</body>
</html>
  Reply With Quote
Old 07-23-2004, 12:32 PM   #144
ghank
Nameless Being
 
Unhappy

Codrut, that URL works fine.

However this one doesn't because it has a + or a %2b in it:

http://www.trimbody.com.au/resources...insurance.html

http://www.trimbody.com.au/resources...insurance.html
  Reply With Quote
Old 07-25-2004, 07:07 PM   #145
Cooper
Junior Member
Cooper began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Jul 2004
Device: O2 XDA
Thumbs up

First of all, Kudos to all the wonderful ppl who accomplished this. I'm quite sure you've given Larry something to think about. It's only a matter of time until we know whether it's gonna last long, which I hope it would.

Even though I'm quite disappointed in missing the fun, there's atleast some hope with http://help.yahoo.com/help/us/companion/webrank. It seems there's already one out, http://www.digitalpoint.com/tools/webrank . Hope to work with u guyz soon.
Cooper is offline   Reply With Quote
Old 07-26-2004, 05:06 AM   #146
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
The problem is that Yahoo uses a special Yahoo Toolbar to enable the WebRank feature, and only beta testers have/had access to this toolbar. And the beta test group is currently filled. So if anyone has a working link to the beta toolbar... would be very useful. The following link used to download the beta toolbar, but it doesn't seem to work anymore: http://companion.yahoo.com/config/sl...one&.cpdl=b543
doctorow is offline   Reply With Quote
Old 07-26-2004, 09:02 AM   #147
Cooper
Junior Member
Cooper began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Jul 2004
Device: O2 XDA
yup.. seems like it. uneasy about the "next version" mentioned. wonder whether it's another beta (http://beta.toolbar.yahoo.com). anyway the toolbar itself is avaiable at http://toolbar.yahoo.com. havent tried it yet though.

one more thing. Does anyone know the exact headers used by the toolbar to retrieve the PR. (I don't use it any longer due to it's privacy issues ). However, if we do know it, then we could simulate the toobar itself to be on the safe side when sending our requests. I found this one a bit interesting http://www.httprevealer.com/usage_google.htm. Want to know what u guys think.
Cooper is offline   Reply With Quote
Old 07-26-2004, 11:45 AM   #148
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 914
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
Yes, but the toolbar available for download doesn't include the PageRank feature (or I am just too blind to see it) ;(

Btw, someone wrote a Javascript version of the algorithm and implemented it as a Firefox extension: http://www.tapouillo.com/firefox_extension/
doctorow is offline   Reply With Quote
Old 07-26-2004, 05:14 PM   #149
Cooper
Junior Member
Cooper began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Jul 2004
Device: O2 XDA
Ya, I'm aware of that. Also the PR I reffered to was for the Google toolbar. Yahoo has WebRank, right ? anyway, I think thier toolbar is more off to combat spyware rather than promote rankings.

how often does google update thier toolbar version, I'm using GoogleToolbar 2.0.111-as the agent now. btw, the firefox extension is neat.. that eliminates the toolbar far more easily.
Cooper is offline   Reply With Quote
Old 07-27-2004, 05:46 AM   #150
Cooper
Junior Member
Cooper began at the beginning.
 
Posts: 5
Karma: 12
Join Date: Jul 2004
Device: O2 XDA
Quote:
Originally Posted by ghank
What are the actual PR's for these URLs ? (again, I don't use GTb )

Btw, I just wrote a mod, which simulates the Toolbar as it is using sockets. However, I'm still waiting for confirmation of the actual headers to make sure it's off the limits for suspicion. Will post it once it's done.
Cooper is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seriously thoughtful Dekker's Algorithm help. Catire Lounge 13 03-19-2010 10:03 AM
Bulk Pagerank Checker Script? SNaRe Lounge 2 10-22-2006 04:36 PM
Google Toolbar Pagerank Checksum Revealed! Alexander Turcic Lounge 5 02-17-2006 08:09 AM
Google Checksum CH calculator cyberax Lounge 2 08-17-2004 09:37 PM


All times are GMT -4. The time now is 10:01 PM.


MobileRead.com is a privately owned, operated and funded community.