Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Szukam skryptu page rank
eMatys
post
Post #1





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 15.01.2006
Skąd: Poznań

Ostrzeżenie: (0%)
-----


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?

Ten post edytował eMatys 11.03.2006, 23:41:05
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
sobstel
post
Post #2





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


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. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.10.2025 - 09:43