Create a display of Google PageRank
Tuesday, June 5, 2007Updated: service unavailable
After the great success of BlogBabel Rank (joke
) - I propose a new antipixel able to view the Google PageRank. On the web there are many services that offer the display and check the Google PageRank. Often, however, "give the numbers" or do not work for several reasons. I had entered one too, but lately, a little 'because of Dreamhost (my provider), a little' for strange reasons related to the network, had begun to fail!
The first thing we worry about is the correct code that can capture the PageRank from Google. The net is full of examples and codes nice and ready! I propose below one in PHP that I had repaired some time ago and currently own and O on l o g. Com.
- $a , $b ) { ZEROFILL function ($ a, $ b) (
- $z & $a ) { if ($ z & $ a) (
- ( $a >> 1 ) ; $ a = ($ a>> 1);
- ( ~ $z ) ; $ a & = (~ $ z);
- 0x40000000 ; $ a | = 0x40000000;
- ( $a >> ( $b - 1 ) ) ; $ a = ($ a>> ($ b - 1));
- { $a = ( $a >> $b ) ; } ) Else ($ a = ($ a> $ b);)
- ; return $ a;
- )
- $a , $b , $c ) { function mix ($ a, $ b, $ c) (
- $b ; $a -= $c ; $a ^ = ( zeroFill ( $c , 13 ) ) ; $ a -= $ b, $ a -= $ c, $ a ^ = (ZEROFILL ($ c, 13));
- $c ; $b -= $a ; $b ^ = ( $a <& lt ; 8 ) ; $ b -= $ c, $ b -= $ a, $ b ^ = ($ a <& lt; 8);
- $a ; $c -= $b ; $c ^ = ( zeroFill ( $b , 13 ) ) ; $ c -= $ a, $ c -= $ b, $ c ^ = (ZEROFILL ($ b, 13));
- $b ; $a -= $c ; $a ^ = ( zeroFill ( $c , 12 ) ) ; $ a -= $ b, $ a -= $ c, $ a ^ = (ZEROFILL ($ c, 12));
- $c ; $b -= $a ; $b ^ = ( $a <& lt ; 16 ) ; $ b -= $ c, $ b -= $ a, $ b ^ = ($ a <& lt; 16);
- $a ; $c -= $b ; $c ^ = ( zeroFill ( $b , 5 ) ) ; $ c -= $ a, $ c -= $ b, $ c ^ = (ZEROFILL ($ b, 5));
- $b ; $a -= $c ; $a ^ = ( zeroFill ( $c , 3 ) ) ; $ a -= $ b, $ a -= $ c, $ a ^ = (ZEROFILL ($ c, 3));
- $c ; $b -= $a ; $b ^ = ( $a <& lt ; 10 ) ; $ b -= $ c, $ b -= $ a, $ b ^ = ($ a <& lt; 10);
- $a ; $c -= $b ; $c ^ = ( zeroFill ( $b , 15 ) ) ; $ c -= $ a, $ c -= $ b, $ c ^ = (ZEROFILL ($ b, 15));
- )
- $url , $length = null , $init = GOOGLE_MAGIC ) { GoogleCH function ($ url, $ length = null, $ init = GOOGLE_MAGIC) (
- $b = 0x9E3779B9 ; $ a = $ b = 0x9E3779B9;
- $init ; $ c = $ init;
- 0 ; $ k = 0;
- $length ; $ len = $ length;
- $len >= 12 ) { while ($ len> = 12) (
- ( $url [ $k + 0 ] + ( $url [ $k + 1 ] <& lt ; 8 ) + ( $url [ $k + 2 ] <& lt ; 16 ) + ( $url [ $k + 3 ] <& lt ; 24 ) ) ; $ a + = ($ url [$ k + 0] + ($ url [$ k + 1] <& lt; 8) + ($ url [$ k + 2] <& lt; 16) + ($ url [ $ k + 3] <& lt; 24));
- ( $url [ $k + 4 ] + ( $url [ $k + 5 ] <& lt ; 8 ) + ( $url [ $k + 6 ] <& lt ; 16 ) + ( $url [ $k + 7 ] <& lt ; 24 ) ) ; $ b + = ($ url [$ k + 4] + ($ url [$ k + 5] <& lt; 8) + ($ url [$ k + 6] <& lt; 16) + ($ url [ $ k + 7] <& lt; 24));
- ( $url [ $k + 8 ] + ( $url [ $k + 9 ] <& lt ; 8 ) + ( $url [ $k + 10 ] <& lt ; 16 ) + ( $url [ $k + 11 ] <& lt ; 24 ) ) ; $ c + = ($ url [$ k + 8] + ($ url [$ k + 9] <& lt; 8) + ($ url [$ k + 10] <& lt; 16) + ($ url [ $ k + 11] <& lt; 24));
- mix ( $a , $b , $c ) ; $ mix = mix ($ a, $ b, $ c);
- $mix [ 0 ] ; $b = $mix [ 1 ] ; $c = $mix [ 2 ] ; $ a = $ mix [0], $ b = $ mix [1], $ c = $ mix [2];
- 12 ; $ k + = 12;
- 12 ; $ len -= 12;
- )
- $length ; $ c + = $ length;
- $len ) { switch ($ len) (
- $c += ( $url [ $k + 10 ] <& lt ; 24 ) ; case 11: $ c + = ($ url [$ k + 10] <& lt; 24);
- $c += ( $url [ $k + 9 ] <& lt ; 16 ) ; case 10: $ c + = ($ url [$ k + 9] <& lt; 16);
- $c += ( $url [ $k + 8 ] <& lt ; 8 ) ; case 9: $ c + = ($ url [$ k + 8] <& lt; 8);
- $b += ( $url [ $k + 7 ] <& lt ; 24 ) ; case 8: $ b + = ($ url [$ k + 7] <& lt; 24);
- $b += ( $url [ $k + 6 ] <& lt ; 16 ) ; case 7: $ b + = ($ url [$ k + 6] <& lt; 16);
- $b += ( $url [ $k + 5 ] <& lt ; 8 ) ; case 6: $ b + = ($ url [$ k + 5] <& lt; 8);
- $b += ( $url [ $k + 4 ] ) ; case 5: $ b + = ($ url [$ k + 4]);
- $a += ( $url [ $k + 3 ] <& lt ; 24 ) ; case 4: $ a + = ($ url [$ k + 3] <& lt; 24);
- $a += ( $url [ $k + 2 ] <& lt ; 16 ) ; case 3: $ a + = ($ url [$ k + 2] <& lt; 16);
- $a += ( $url [ $k + 1 ] <& lt ; 8 ) ; case 2: $ a + = ($ url [$ k + 1] <& lt; 8);
- $a += ( $url [ $k + 0 ] ) ; case 1: $ a + = ($ url [$ k + 0]);
- )
- mix ( $a , $b , $c ) ; $ mix = mix ($ a, $ b, $ c);
- [ 2 ] ; return $ mix [2];
- )
- $string ) { strord function ($ string) (
- ; return $ result;
- )
- $link ) { ReadPR function ($ link) (
- ! $fp ) { if ($ fp) (
- ( $errno ) \n " ; echo "$ errstr ($ errno) \ n";
- { ) Else (
- "GET $link HTTP/1.0 \r \n " ; $ out = "GET $ link HTTP/1.0 \ r \ n";
- "Host: toolbarqueries.google.com \r \n " ; $ out .= "Host: toolbarqueries.google.com \ r \ n";
- "User-Agent: Mozilla/4.0 (compatible; GoogleToolbar 2.0.114.9-big; Windows 5.2) \r \n " ; $ out .= "User-Agent: Mozilla/4.0 (compatible; GoogleToolbar 2.0.114.9-big; Windows 5.2) \ r \ n";
- "Connection: Close \r \n \r \n " ; $ out .= "Connection: Close \ r \ n \ r \ n";
- do (
- ( $line !== " \r \n " ) ; ) While ($ line! == "\ R \ n");
- ; return $ data;
- )
- )
- $url ) { GetPR function ($ url) (
- 'info:' . $url ; $ url = 'info:'. $ url;
- GoogleCH ( strord ( $url ) ) ; $ ch = GoogleCH (strord ($ url));
- ReadPR ( "/search?client=navclient-auto&ch=6 $ch &features=Rank&q= $url " ) ; $ data = ReadPR ( "/ search? client = navclient-auto & ch = 6 $ ch & features = Rank & q = $ url");
- [ 2 ] ; return $ rankarray [2];
- )
- "Location: http://www.undolog.com/services/gpr/ $gr .gif" ) ; Header ( "Location: $ http://www.undolog.com/services/gpr/ gr. gif");
- )
NOTE: I apologize to the original author but in the version I found I had no comments or notes of copyright / license!
Commenting on the PHP code exempts from this place, but it is easy to see that the complexity of the calculations carried out both by Google itself, this code word, Google will come out of some office ...
The part that you can customize is the following:
- "Location: http://www.undolog.com/services/gpr/ $gr .gif" ) ; header ( "Location: $ http://www.undolog.com/services/gpr/ gr. gif");
- )
The code I use to play it on a page is:
- "_blank" href = "http://www.undolog.com" ><img src = "http://www.undolog.com/services/gr.php?url=http://www.undolog.com" border = "0" alt = "" / >< / a> <a href = target = "_blank" "http://www.undolog.com"> <img src = "http://www.undolog.com/services/gr.php?url=http://www. undolog.com "border =" 0 "alt =" "/> </ a>
An interesting technical note covers the section of PHP code that retrieves the "page" containing our Google PageRank. As you can see from the extract of code below, instead of using CURL library functions (already seen in other places) or fopen() opens directly into a socket using the function fsockopen() Basically you run a real FTP connection (on port 80 - HTTP protocol standards) by requiring (as does our browser) the page you want:
The creative (and here you can pick any) relates to the graphic image instead dell'antipixel. In this case it's all pretty simple, considering that Google's PageRank varies from a minimum of 0 (zero) to a maximum of 10 (ten). We can then prepare 11 "Imagine" to be invoked based on the PageRank calculated as shown below:

In my case I named the pages: 0.gif, 1.gif, 2.gif, ..., 10.gif (the first one to be avoided, the last to dream!)













I do not think that the code works.
[...] Improvements to the script for the Google PageRank Tags: antipixel, Google, Google PageRank Viever, Internet, PageRank, PHP, Development, Michele Mader WordpressGrazie to have found and fixed a bug in the code for displaying the Google Rank . Find the details here. antipixel, Google, Google PageRank Viever, Internet, PageRank, PHP, Development, Wordpress These icons link to social bookmarking sites where readers can share and discover new web pages. [...]
Can someone help me.
Tried every way possible in PHP.
Not work.
Better
I can not make it work
Sincerely