Create a display of Google PageRank

Update: Not Available

After the huge success of BlogBabel Rank (joke ;) ) - I propose a new antipixel able to display the Google PageRank. On the web there are many services that offer the display and check the Google PageRank. Often, however, "give numbers" or do not work for several reasons. I had entered one myself, but lately, a little 'because of Dreamhost (my provider), a little' strange for reasons connected to the network, he started to not work!

The first thing we worry about is to get the code that captures Google PageRank. The net is full of examples and code beautiful and ready! We propose below a PHP that I had remedied some time ago and I currently use on their own or und l o g. Com.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
'GOOGLE_MAGIC' , 0xE6359A60 ) ; define ('GOOGLE_MAGIC', 0xE6359A60);

$a , $b ) { zerofill function ($ a, $ b) {
hexdec ( 80000000 ) ; $ Z = hexdec (80000000);
$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));

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

$url , $length = null , $init = GOOGLE_MAGIC ) { GoogleCH function ($ url, $ length = null, $ init = GOOGLE_MAGIC) {
is_null ( $length ) ) { $length = sizeof ( $url ) ; } if ( is_null ($ length)) {$ length = sizeof ($ url);}
$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) {
$i = 0 ; $i < strlen ( $string ) ; $i ++ ) { $result [ $i ] = ord ( $string { $i } ) ; } for ($ i = 0; $ i < strlen ($ string) $ i + +) {$ result [$ i] = ord ($ string {$ i});}
; return $ result;
}

$link ) { ReadPR function ($ link) {
fsockopen ( "www.google.com" , 80 , $errno , $errstr , 30 ) ; $ Fp = fsockopen ("www.google.com", 80, $ errno, $ errstr, 30);
! $fp ) { if ($ fp) {
( $errno ) \n " ; echo "$ errstr ($ errno) \ n";
1 ) ; exit (1);
{ 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 big-2.0.114.9, Windows 5.2) \ r \ n";
"Connection: Close \r \n \r \n " ; $ Out .= "Connection: Close \ r \ n \ r \ n";
$fp , $out ) ; fwrite ($ fp, $ out);
do {
fgets ( $fp , 128 ) ; $ Line = fgets ($ fp, 128);
( $line !== " \r \n " ) ; } While ($ line! == "\ R \ n");
fread ( $fp , 8192 ) ; $ Data = fread ($ fp, 8192);
$fp ) ; fclose ($ fp);
; 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 " ) ; ReadPR $ data = ("/ search? Navclient-Car & client = ch ch = $ 6 & features = Rank & q = $ url");
explode ( ':' , $data ) ; $ Rankarray = explode (':', $ data);
[ 2 ] ; return $ rankarray [2];
}
isset ( $_GET [ 'url' ] ) && $_GET [ 'url' ] !== '' ) { if ( isset ($ _GET ['url']) & & $ _GET ['url']! =='') {
trim ( GetPR ( $_GET [ 'url' ] ) ) ; $ G = trim (GetPR ($ _GET ['url']));
"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 the version that I found there were no comments or notes copyright / license!

Comment PHP code exempts from this post, but it is easy to see that the complexity of the calculations is done by Google itself, this code, in other words, Google will come out of some office ...

The part that you can customize is the following:

1
2
3
4
isset ( $_GET [ 'url' ] ) && $_GET [ 'url' ] !== '' ) { if ( isset ($ _GET ['url']) & & $ _GET ['url']! =='') {
trim ( GetPR ( $_GET [ 'url' ] ) ) ; $ G = trim (GetPR ($ _GET ['url']));
"Location: http://www.undolog.com/services/gpr/ $gr .gif" ) ; header ("Location: $ http://www.undolog.com/services/gpr/ gr. gif");
}

The code I use to view the page:

1

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 the CURL library functions (already seen in other post) or fopen() , opens directly into a socket using the function fsockopen() . Basically you run a real FTP connection (on port 80 - the standard HTTP protocol) requiring (as does our browser) to the desired page:

1
fsockopen ( "www.google.com" , 80 , $errno , $errstr , 30 ) ; $ Fp = fsockopen ("www.google.com", 80, $ errno, $ errstr, 30);

The creative (and here you can pick any) concerns the graphic image dell'antipixel. In this case it's all quite simple as the Google PageRank varies from a minimum of 0 (zero) to a maximum of 10 (ten). We can then prepare 11 "Imagine" to be called according to PageRank calculated, as shown below:

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

3 comments to "Create a Google PageRank of the viewer"

  1. June 14, 2007 Michael Mader :

    I do not think that the code works.

  2. June 18, 2007 undolog »Blog Archive» Improvements to the script for Google PageRank :

    [...] Improvements to the script for Google PageRank Tags: antipixel, google, Google PageRank Viever, Internet, PageRank, PHP Development, WordPressGrazie to Michael Mader for having found and fixed a bug in the code to display 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 over and discover new web pages. [...]

  3. July 22, 2007 Webmaster Friend :

    Can anyone help me.
    Tried in all possible way the php.
    It does not work.
    Better
    I can not make it work
    Sincerely

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA