Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Szukam skryptu page rank
Forum PHP.pl > Forum > Gotowe rozwiązania > Szukam
eMatys
na jednej ze stron znalazłem super program http://www.pagerank.empe3.net/check.php
problem w tym ze niewiem jak sie nazywa ten skrypt, pomógłby mi ktos odszukac go?
sobstel
mam nieodparte wrażenie, że na googlach dałoby się znaleźć bez problemu, ale że wstałem dzisiaj prawą nogą :

  1. <?php 
  2. // php Google PageRank Calculator Script 
  3. // -------------------------- April 2005 
  4. // Contact author: pagerankscript@googlecommunity.com 
  5.  
  6. // for updates, visit: 
  7. // http://www.googlecommunity.com/scripts/google-pagerank.php 
  8.  
  9. // provided by www.GoogleCommunity.com 
  10. // an unofficial community of Google fans 
  11. // --------------------------------------- 
  12.  
  13. // Instructions 
  14. // Upload pagerank.php to your server 
  15. // Call it like this: http://www.example.com/pagerank.php?url=http://www.yahoo.com/ 
  16. //  example.com is your website. yahoo.com is the website to get the PR of 
  17. // The code below displays the PR for $url 
  18.  
  19. /* 
  20. This code is released unto the public domain 
  21. */ 
  22. //header("Content-Type: text/plain; charset=utf-8"); 
  23. define('GOOGLE_MAGIC', 0xE6359A60); 
  24.  
  25. //unsigned shift right 
  26. function zeroFill($a, $b) 
  27. { 
  28. $z = hexdec(80000000); 
  29. if ($z & $a) 
  30. { 
  31. $a = ($a>>1); 
  32. $a &= (~$z); 
  33. $a |= 0x40000000; 
  34. $a = ($a>>($b-1)); 
  35. } 
  36. else 
  37. { 
  38. $a = ($a>>$b); 
  39. } 
  40. return $a; 
  41. } 
  42.  
  43. function mix($a,$b,$c) { 
  44. $a -= $b; $a -= $c; $a ^= (zeroFill($c,13)); 
  45. $b -= $c; $b -= $a; $b ^= ($a<<8); 
  46. $c -= $a; $c -= $b; $c ^= (zeroFill($b,13)); 
  47. $a -= $b; $a -= $c; $a ^= (zeroFill($c,12)); 
  48. $b -= $c; $b -= $a; $b ^= ($a<<16); 
  49. $c -= $a; $c -= $b; $c ^= (zeroFill($b,5)); 
  50. $a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
  51. $b -= $c; $b -= $a; $b ^= ($a<<10); 
  52. $c -= $a; $c -= $b; $c ^= (zeroFill($b,15)); 
  53.  
  54. return array($a,$b,$c); 
  55. } 
  56.  
  57. function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) { 
  58. if(is_null($length)) { 
  59. $length = sizeof($url); 
  60. } 
  61. $a = $b = 0x9E3779B9; 
  62. $c = $init; 
  63. $k = 0; 
  64. $len = $length; 
  65. while($len >= 12) { 
  66. $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24)); 
  67. $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24)); 
  68. $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24)); 
  69. $mix = mix($a,$b,$c); 
  70. $a = $mix[0]; $b = $mix[1]; $c = $mix[2]; 
  71. $k += 12; 
  72. $len -= 12; 
  73. } 
  74.  
  75. $c += $length; 
  76. switch($len) /* all the case statements fall through */ 
  77. { 
  78. case 11: $c+=($url[$k+10]<<24); 
  79. case 10: $c+=($url[$k+9]<<16); 
  80. case 9 : $c+=($url[$k+8]<<8); 
  81. /* the first byte of c is reserved for the length */ 
  82. case 8 : $b+=($url[$k+7]<<24); 
  83. case 7 : $b+=($url[$k+6]<<16); 
  84. case 6 : $b+=($url[$k+5]<<8); 
  85. case 5 : $b+=($url[$k+4]); 
  86. case 4 : $a+=($url[$k+3]<<24); 
  87. case 3 : $a+=($url[$k+2]<<16); 
  88. case 2 : $a+=($url[$k+1]<<8); 
  89. case 1 : $a+=($url[$k+0]); 
  90.  /* case 0: nothing left to add */ 
  91. } 
  92. $mix = mix($a,$b,$c); 
  93. /*-------------------------------------------- report the result */ 
  94. return $mix[2]; 
  95. } 
  96.  
  97. //converts a string into an array of integers containing the numeric value of the 
    char 
  98. function strord($string) { 
  99. for($i=0;$i<strlen($string);$i++) { 
  100. $result[$i] = ord($string{$i}); 
  101. } 
  102. return $result; 
  103. } 
  104.  
  105. function getrank($url) { 
  106. $url = 'info:'.$url; 
  107. $ch = GoogleCH(strord($url)); 
  108. $file = "http://www.google.com/search?client=navclient-auto&ch=6$ch&features=Rank&q=$url"; 
  109. $data = file($file); 
  110. $rankarray = explode (':', $data[2]); 
  111. $rank = $rankarray[2]; 
  112. return $rank; 
  113. } 
  114.  
  115. echo 'PageRank: '.getrank($_REQUEST["REQUEST_URI"]).'<br /><small>provided by <a href="http://www.googlecommunity.com/" target="_blank">Google Community.com</a></small>'; 
  116.  
  117. ?>
eMatys
No tak nie do końca, poszukuje skryptu który pozwalałbym wygenerować obrazek z wartością pagerank tak by ktoś mógł sobie sprawdzić za pośrednictwem mojej strony. Dzięki temu ktoś bedzie mógł sprawdzić swój pagerank a ja bede zwiekszał swój. Kolejnym przykładem może być strona: http://www.dodaj.pl/pr_meter.php choć rozwiązanie z js mi się bardziej podoba.

Fakt znalazłem kilka programów w googlach sprawdzający pagerank, ale zaden nie sprostał moim oczekiwaniom. Dlatego zwracam się ponownie z prośba o pomoc.
d3mon
nie ma gotowego skryptu, sam szukalem przez kilka dni.. musisz sobie sam napisac smile.gif
podpowiem ci ze jako wynik musisz dac:
  1. <?php
  2.  
  3. header("Content-type: image/PNG");
  4. $obrazek = ImageCreateFromPng("_nazwapliku.png_");
  5. ImagePng($obrazek);
  6. ImageDestroy($obrazek);
  7.  
  8. ?>

PS.
Mi sie udalo www.d3mon.jx.pl/pagerank
jj09
Cytat(sopel @ 12.03.2006, 09:05:57 ) *
mam nieodparte wrażenie, że na googlach dałoby się znaleźć bez problemu, ale że wstałem dzisiaj prawą nogą :

  1. <?php 
  2. // php Google PageRank Calculator Script 
  3. // -------------------------- April 2005 
  4. // Contact author: pagerankscript@googlecommunity.com 
  5.  
  6. // for updates, visit: 
  7. // <a href=\"http://www.googlecommunity.com/scripts/google-pagerank.php\" target=\"_blank\">http://www.googlecommunity.com/scripts/google-pagerank.php</a> 
  8.  
  9. // provided by www.GoogleCommunity.com 
  10. // an unofficial community of Google fans 
  11. // --------------------------------------- 
  12.  
  13. // Instructions 
  14. // Upload pagerank.php to your server 
  15. // Call it like this: <a href=\"http://www.example.com/pagerank.php?url=http://www.yahoo.com/\" target=\"_blank\">http://www.example.com/pagerank.php?url=ht.../www.yahoo.com/</a> 
  16. //  example.com is your website. yahoo.com is the website to get the PR of 
  17. // The code below displays the PR for $url 
  18.  
  19. /* 
  20. This code is released unto the public domain 
  21. */ 
  22. //header("Content-Type: text/plain; charset=utf-8"); 
  23. define('GOOGLE_MAGIC', 0xE6359A60); 
  24.  
  25. //unsigned shift right 
  26. function zeroFill($a, $b) 
  27. { 
  28. $z = hexdec(80000000); 
  29. if ($z & $a) 
  30. { 
  31. $a = ($a>>1); 
  32. $a &= (~$z); 
  33. $a |= 0x40000000; 
  34. $a = ($a>>($b-1)); 
  35. } 
  36. else 
  37. { 
  38. $a = ($a>>$b); 
  39. } 
  40. return $a; 
  41. } 
  42.  
  43. function mix($a,$b,$c) { 
  44. $a -= $b; $a -= $c; $a ^= (zeroFill($c,13)); 
  45. $b -= $c; $b -= $a; $b ^= ($a<<8); 
  46. $c -= $a; $c -= $b; $c ^= (zeroFill($b,13)); 
  47. $a -= $b; $a -= $c; $a ^= (zeroFill($c,12)); 
  48. $b -= $c; $b -= $a; $b ^= ($a<<16); 
  49. $c -= $a; $c -= $b; $c ^= (zeroFill($b,5)); 
  50. $a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
  51. $b -= $c; $b -= $a; $b ^= ($a<<10); 
  52. $c -= $a; $c -= $b; $c ^= (zeroFill($b,15)); 
  53.  
  54. return array($a,$b,$c); 
  55. } 
  56.  
  57. function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) { 
  58. if(is_null($length)) { 
  59. $length = sizeof($url); 
  60. } 
  61. $a = $b = 0x9E3779B9; 
  62. $c = $init; 
  63. $k = 0; 
  64. $len = $length; 
  65. while($len >= 12) { 
  66. $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24)); 
  67. $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24)); 
  68. $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24)); 
  69. $mix = mix($a,$b,$c); 
  70. $a = $mix[0]; $b = $mix[1]; $c = $mix[2]; 
  71. $k += 12; 
  72. $len -= 12; 
  73. } 
  74.  
  75. $c += $length; 
  76. switch($len) /* all the case statements fall through */ 
  77. { 
  78. case 11: $c+=($url[$k+10]<<24); 
  79. case 10: $c+=($url[$k+9]<<16); 
  80. case 9 : $c+=($url[$k+8]<<8); 
  81. /* the first byte of c is reserved for the length */ 
  82. case 8 : $b+=($url[$k+7]<<24); 
  83. case 7 : $b+=($url[$k+6]<<16); 
  84. case 6 : $b+=($url[$k+5]<<8); 
  85. case 5 : $b+=($url[$k+4]); 
  86. case 4 : $a+=($url[$k+3]<<24); 
  87. case 3 : $a+=($url[$k+2]<<16); 
  88. case 2 : $a+=($url[$k+1]<<8); 
  89. case 1 : $a+=($url[$k+0]); 
  90.  /* case 0: nothing left to add */ 
  91. } 
  92. $mix = mix($a,$b,$c); 
  93. /*-------------------------------------------- report the result */ 
  94. return $mix[2]; 
  95. } 
  96.  
  97. //converts a string into an array of integers containing the numeric value of the 
    char 
  98. function strord($string) { 
  99. for($i=0;$i<strlen($string);$i++) { 
  100. $result[$i] = ord($string{$i}); 
  101. } 
  102. return $result; 
  103. } 
  104.  
  105. function getrank($url) { 
  106. $url = 'info:'.$url; 
  107. $ch = GoogleCH(strord($url)); 
  108. $file = "http://www.google.com/search?client=navclient-auto&ch=6$ch&features=Rank&q=$url"; 
  109. $data = file($file); 
  110. $rankarray = explode (':', $data[2]); 
  111. $rank = $rankarray[2]; 
  112. return $rank; 
  113. } 
  114.  
  115. echo 'PageRank: '.getrank($_REQUEST["REQUEST_URI"]).'<br /><small>provided by <a href="http://www.googlecommunity.com/" target="_blank">Google Community.com</a></small>'; 
  116.  
  117. ?>

wstawiłem do siebie i mi pokazuje coś takiego:
Cytat
Warning: file(http://www.google.com/search?client=navclient-auto&ch=61054125718&features=Rank&q=info:) [function.file]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/dsj/domains/dsj-online.pl/public_html/pagerank.php on line 109
PageRank:
provided by Google Community.com
f1xer
Ogólnie to google udostępniło klasę do sprawdzania wartości PageRank odsyłam do tego artykułu
gryzly123
jest taka strona 4free.pl zajrzyj, tam jest to o co ci chodzi oraz tworzenie sond i wiele więcej.
to chyba prostrze od pisania własnego skryptu laugh.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.