|
|
|
|
$pr =
file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$adress");
Configuration: Windows XP Firefox 2.0.0.4
Il prend le résultat HTML de la page : "http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&;oe=UTF-8&features=Rank&q=$adress" que tu as passé en paramètre et l'insert dans ton tableau nommé $pr.
Chaque indice de ton tableau $pr contiendra une ligne du résultat de la page HTML. Ce qui me semble faut dans ton script et qui ferait qu'il ne marche pas est le $adress pas pris en compte par php là. Essaie : $pr = file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&;oe=UTF-8&features=Rank&q=".$adress); (J'ai déplacé le guillemet) |
Oups, oublié la source pour PHP : http://fr.php.net/file |
comprends plus ... tout fonctionnait impec depuis trois mois et plus du tout depuis deux jours ...
voici le code source de la page: <?php
define('GMAG', 0xE6359A60);
//unsigned shift right
function zeroFill($a, $b)
{
$z = hexdec(80000000);
if ($z & $a)
{
$a = ($a>>1);
$a &= (~$z);
$a |= 0x40000000;
$a = ($a>>($b-1));
}
else
{
$a = ($a>>$b);
}
return $a;
}
function mix($a,$b,$c) {
$a -= $b; $a -= $c; $a ^= (zeroFill($c,13));
$b -= $c; $b -= $a; $b ^= ($a<<8);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,13));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,12));
$b -= $c; $b -= $a; $b ^= ($a<<16);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,5));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
$b -= $c; $b -= $a; $b ^= ($a<<10);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,15));
return array($a,$b,$c);
}
function GCH($adress, $length=null, $init=GMAG) {
if(is_null($length)) {
$length = sizeof($adress);
}
$a = $b = 0x9E3779B9;
$c = $init;
$k = 0;
$len = $length;
while($len >= 12) {
$a += ($adress[$k+0] +($adress[$k+1]<<8) +($adress[$k+2]<<16)
+($adress[$k+3]<<24));
$b += ($adress[$k+4] +($adress[$k+5]<<8) +($adress[$k+6]<<16)
+($adress[$k+7]<<24));
$c += ($adress[$k+8] +($adress[$k+9]<<8)
+($adress[$k+10]<<16)+($adress[$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) /* all the case statements fall through */
{
case 11: $c+=($adress[$k+10]<<24);
case 10: $c+=($adress[$k+9]<<16);
case 9 : $c+=($adress[$k+8]<<8);
/* the first byte of c is reserved for the length */
case 8 : $b+=($adress[$k+7]<<24);
case 7 : $b+=($adress[$k+6]<<16);
case 6 : $b+=($adress[$k+5]<<8);
case 5 : $b+=($adress[$k+4]);
case 4 : $a+=($adress[$k+3]<<24);
case 3 : $a+=($adress[$k+2]<<16);
case 2 : $a+=($adress[$k+1]<<8);
case 1 : $a+=($adress[$k+0]);
/* case 0: nothing left to add */
}
$mix = mix($a,$b,$c);
/*-------------------------------------------- report the result */
return $mix[2];
}
//converts a string into an array of integers containing the numeric value of the char
function strord($string) {
for($i=0;$i<strlen($string);$i++) {
$result[$i] = ord($string{$i});
}
return $result;
}
function getPR($_url) {
$adress = 'info:'.$_url;
$ch = GCH(strord($adress));
$adress='info:'.urlencode($_url);
$pr =
file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$adress");
$pr_str = implode("", $pr);
return substr($pr_str,strrpos($pr_str, ":")+1);
}
?>
@+ b g le 'www' est fait aussi pour communiquer, partager et échanger, non ? |
a récupérer le pr d'une page.
ne fonctionne pas selon les serveurs. J'ai toujours aimé le désert. On s'assoit sur une dune de sable. On ne voit rien. On n'entend rien. Et cependant quelque chose rayonne en silence... [A.S-E.]
|
pour php;ini:
allow_url_fopen = on et pour pr.php <?php
define('GMAG', 0xE6359A60);
//unsigned shift right
function zeroFill($a, $b)
{
$z = hexdec(80000000);
if ($z & $a)
{
$a = ($a>>1);
$a &= (~$z);
$a |= 0x40000000;
$a = ($a>>($b-1));
}
else
{
$a = ($a>>$b);
}
return $a;
}
function mix($a,$b,$c) {
$a -= $b; $a -= $c; $a ^= (zeroFill($c,13));
$b -= $c; $b -= $a; $b ^= ($a<<8);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,13));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,12));
$b -= $c; $b -= $a; $b ^= ($a<<16);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,5));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
$b -= $c; $b -= $a; $b ^= ($a<<10);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,15));
return array($a,$b,$c);
}
function GCH($adress, $length=null, $init=GMAG) {
if(is_null($length)) {
$length = sizeof($adress);
}
$a = $b = 0x9E3779B9;
$c = $init;
$k = 0;
$len = $length;
while($len >= 12) {
$a += ($adress[$k+0] +($adress[$k+1]<<8) +($adress[$k+2]<<16)
+($adress[$k+3]<<24));
$b += ($adress[$k+4] +($adress[$k+5]<<8) +($adress[$k+6]<<16)
+($adress[$k+7]<<24));
$c += ($adress[$k+8] +($adress[$k+9]<<8)
+($adress[$k+10]<<16)+($adress[$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) /* all the case statements fall through */
{
case 11: $c+=($adress[$k+10]<<24);
case 10: $c+=($adress[$k+9]<<16);
case 9 : $c+=($adress[$k+8]<<8);
/* the first byte of c is reserved for the length */
case 8 : $b+=($adress[$k+7]<<24);
case 7 : $b+=($adress[$k+6]<<16);
case 6 : $b+=($adress[$k+5]<<8);
case 5 : $b+=($adress[$k+4]);
case 4 : $a+=($adress[$k+3]<<24);
case 3 : $a+=($adress[$k+2]<<16);
case 2 : $a+=($adress[$k+1]<<8);
case 1 : $a+=($adress[$k+0]);
/* case 0: nothing left to add */
}
$mix = mix($a,$b,$c);
/*-------------------------------------------- report the result */
return $mix[2];
}
//converts a string into an array of integers containing the numeric value of the char
function strord($string) {
for($i=0;$i<strlen($string);$i++) {
$result[$i] = ord($string{$i});
}
return $result;
}
function getPR($_url) {
$adress = 'info:'.$_url;
$ch = GCH(strord($adress));
$adress='info:'.urlencode($_url);
$pr =
file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$adress");
$pr_str = implode("", $pr);
return substr($pr_str,strrpos($pr_str, ":")+1);
}
?>
@+ b g le 'www' est fait aussi pour communiquer, partager et échanger, non ?
|
Hello,
je relance le sujet ayant le même problème avec la même fonction et sur le même hoster (one&one) mais je sais pas si c'est pas le protocole google ki a changer ou si sa vient du serveur, a tu trouvé solution a ton problème bg62 ? car j'essais de tester l'url google du script mais sa me renvoi une erreur est-ce moi qui passe pas les bon paramètres ou c bien le protocole qui a changer ? merci d'avance de donné des news bg52. |
la requète par ce serveur semble être bannie ... il faut donc trouver un autre système ....
le 'www' est fait aussi pour communiquer, partager et échanger, non ? |
La tu trouvé cette solution ?
je suis entrain de regarder du cotés du script de Freeglobe, mais c plus lourd !!! |
prendre le résultat d'un ou plusieurs sites en ligne qui eux sont acceptés ... pas toujours très fiable, mais ... bon !
le 'www' est fait aussi pour communiquer, partager et échanger, non ? |
Résultats pour signification [php]
Résultats pour signification [php]
Résultats pour signification [php]