Где можно взять работающий скрипт определения PR?

12
BN
На сайте с 12.08.2004
Offline
161
#11
webarray:
Гм.. но не один из них неработает.

Warning: fopen(http://www.google.com/search?client=navclient-auto&ch=62147609737&features=Rank&q=info:http://www.site.ru/) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

А на какой версии php тестилось?

Если на 5.х, то там может не правильно считаться сонтрольная сумма. (что очень похоже)

попробуй на другом сервере, если есть возможность

!kt0
На сайте с 28.06.2006
Offline
46
#12
Bolibok_Nikolay:
А на какой версии php тестилось?
Если на 5.х, то там может не правильно считаться сонтрольная сумма. (что очень похоже)
попробуй на другом сервере, если есть возможность

100% что неправильно считается контрольная сумма. Мой скрипт работал на php5, а на php4 не тестил. Сейчас проверю

http://seorepa.com/ (http://seorepa.com/) - блог был там, пока не запилили mchost
D
На сайте с 10.10.2005
Offline
28
#13

Можно тут брать в XML

http://tr.qupa.com/workshop/pagerank.cgi

Я не SEO я программист PERL (Apache 1.3.37 + mod_perl)!!!!! А ещё я люблю FastCGI
!kt0
На сайте с 28.06.2006
Offline
46
#14

Вру сорри. На пхп 5 с денвера срабатывает, а с хостинга php5 - нет. Дело не в php

W
На сайте с 21.06.2006
Offline
19
#15

http://www.google.com/search?client=.....:http://www.ya.ru/

выдает не верную страницу.

может нужно обращаться к другой странице, для определения pr?

LPS v1.1 - система оценки стоимости ссылки с сайта (http://www.openseo.ru/lps/) *новая версия PHP(ООП), MySQL: Cкрипты, Разработка CMS, Веб приложения, SEO сервисы.. (/ru/forum/160619) А Вы Яндекс? (http://www.openseo.ru)
!kt0
На сайте с 28.06.2006
Offline
46
#16
webarray:
http://www.google.com/search?client=.....:http://www.ya.ru/

выдает не верную страницу.

может нужно обращаться к другой странице, для определения pr?

Цифра в урле - контрольная сумма. Генерируется для каждого урла отдельно: http://www.google.com/search?client=navclient-auto&ch=6-212304735&features=Rank&q=info:http://www.ya.ru/

6-212304735

W
На сайте с 21.06.2006
Offline
19
#17

Все нашел, если кому надо то вот рабочий вариант:


<?php
define('GMAG', 0xE6359A60);
function nooverflow($a)
{
while ($a<-2147483648)
$a+=2147483648+2147483648;
while ($a>2147483647)
$a-=2147483648+2147483648;
return $a;
}
function zeroFill ($x, $bits)
{
if ($bits==0) return $x;
if ($bits==32) return 0;
$y = ($x & 0x7FFFFFFF) >> $bits;
if (0x80000000 & $x) {
$y |= (1<<(31-$bits));
}
return $y;
}
function mix($a,$b,$c) {
$a=(int)$a; $b=(int)$b; $c=(int)$c;
$a -= $b; $a -= $c; $a=nooverflow($a); $a ^= (zeroFill($c,13));
$b -= $c; $b -= $a; $b=nooverflow($b); $b ^= ($a<<8);
$c -= $a; $c -= $b; $c=nooverflow($c); $c ^= (zeroFill($b,13));
$a -= $b; $a -= $c; $a=nooverflow($a); $a ^= (zeroFill($c,12));
$b -= $c; $b -= $a; $b=nooverflow($b); $b ^= ($a<<16);
$c -= $a; $c -= $b; $c=nooverflow($c); $c ^= (zeroFill($b,5));
$a -= $b; $a -= $c; $a=nooverflow($a); $a ^= (zeroFill($c,3));
$b -= $c; $b -= $a; $b=nooverflow($b); $b ^= ($a<<10);
$c -= $a; $c -= $b; $c=nooverflow($c); $c ^= (zeroFill($b,15));
return array($a,$b,$c);
}
function GCH($url, $length=null, $init=GMAG) {
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)
{
case 11: $c+=($url[$k+10]<<24);
case 10: $c+=($url[$k+9]<<16);
case 9 : $c+=($url[$k+8]<<8);
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]);
}
$mix = mix($a,$b,$c);
return $mix[2];
}
function strord($string)
{
for($i=0;$i<strlen($string);$i++)
{
$result[$i] = ord($string{$i});
}
return $result;
}

function getPageRank($aUrl)
{
$url = 'info:'.$aUrl;
$ch = GCH(strord($url));
$url='info:'.urlencode($aUrl);
$pr = @file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$url");
$pr_str = @implode("", $pr);
return substr($pr_str,strrpos($pr_str, ":")+1);
}

echo getPageRank($url);
?>

пробуем:

pr.php?url=www.site.ru

A
На сайте с 16.10.2006
Offline
3
#18

А вот из тулбара примерный код :)


<?
function _BF_SHR32($x, $bits) {
if ($bits==0) return $x;
if ($bits==32) return 0;
$y = ($x & 0x7FFFFFFF) >> $bits;
if (0x80000000 & $x) {
$y |= (1<<(31-$bits));
}
return $y;
}
function _pr_toHex8($num) {
return($num < 16 ? "0" : "").dechex($num);
}

function _pr_hexEncodeU32($num) {
$result = _pr_toHex8(_BF_SHR32($num,24));
$result .= _pr_toHex8(_BF_SHR32($num,16) & 255);
$result .= _pr_toHex8(_BF_SHR32($num,8) & 255);
return $result._pr_toHex8($num & 255);
}
function _pr_hash($value) {
$kindOfThingAnIdiotWouldHaveOnHisLuggage = 16909125;
$_pr_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
for($i = 0;$i < strlen($value);$i++ ) {
$kindOfThingAnIdiotWouldHaveOnHisLuggage ^= ord(substr($_pr_HASH_SEED,($i % strlen($_pr_HASH_SEED)),1)) ^ ord(substr($value,$i,1));
$kindOfThingAnIdiotWouldHaveOnHisLuggage = (_BF_SHR32($kindOfThingAnIdiotWouldHaveOnHisLuggage,23) | $kindOfThingAnIdiotWouldHaveOnHisLuggage << 9);
}
return _pr_hexEncodeU32($kindOfThingAnIdiotWouldHaveOnHisLuggage);
}

function getPageRank($aUrl)
{
$file='http://toolbarqueries.google.com/search?sourceid=navclient-ff&features=Rank&client=navclient-auto-ff&ch=8'._pr_hash($url).'&q=info:'.$url;
$data = file($file);
$rankarray = explode (':', $data[2]);
$rank = $rankarray[2];
return $rank;
}

?>
<? echo '!'.getPageRank($URL); ?>

Где URL адрес Вашего сайта

M
На сайте с 20.08.2004
Offline
376
#19

Такая же проблема с скриптом, локально работает, на сервере отказывается.

Задал вопрос хостеру, я насколкько понял, он товарищам из гугла и вот что они ответили.

Your client does not have permission to get URL
/search?client=navclient-auto&ch=6$ch&features=Rank&q=info:ююююю
from this server. (Client IP address: 66.36.ююююю)
Please see Google's Terms of Service posted at http://www.google.com/terms_of_service.html

If you believe that you have received this response in error, please report your problem. However, please make
sure to
take a look at our Terms of Service (http://www.google.com/terms_of_service.html). In your email, please send us
the
entire code displayed below. Please also send us any information you may know about how you are performing your
Google
searches-- for example, "I'm using the Opera browser on Linux to do searches from home. My Internet access is
through a
dial-up account I have with the FooCorp ISP." or "I'm using the Konqueror browser on Linux to search from my job
at
myFoo.com. My machine's IP address is 10.20.30.40, but all of myFoo's web traffic goes through some kind of proxy
server
whose IP address is 10.11.12.13." (If you don't know any information like this, that's OK. But this kind of
information
can help us track down problems, so please tell us what you can.)

We will use all this information to diagnose the problem, and we'll hopefully have you back up and searching with
Google
again quickly!

Please note that although we read all the email we receive, we are not always able to send a personal response to
each
and every email. So don't despair if you don't hear back from us!

Also note that if you do not send us the entire code below, we will not be able to help you.

Best wishes,
The Google Team

как по мне странный ответ с гугла )

отец сыночка, лапочки дочки и еще одного сыночка
12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий