'; //echo getYandexIdx($site).'
'; //echo getYaCat($site).'
'; //echo getDMOZ($site).'
'; //echo getPR($site).'
'; //echo getTIC($site).'
'; // var_dump(getYaRankRead($site)); // возвращает массив из 2х чисел - Рейтинг и Кол-во читателей по версии Яндекс - Блоги ////////////////////////////////// function getFBFeedUrl($site) // возвращает урл фида в фидбурнере например для blog.gtalex.ru это http://feed.feedburner.com/GtalexBlog { if (!($buf = file_get_contents("http://$site"))) return -1; if (preg_match('!href\=\"(http\:\/\/feeds\d*\.feedburner\.com\/.*?)\"!', $buf, $match)) { return ($match[1]); } else { return (-1); } } function getFBReadersCnt($fbname) // возвращает количество подписчиков по заданному фиду { $sResp = get_buf('https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri='.$fbname); preg_match('/circulation="(\d+)"/', $sResp, $a); //Если была ошибка, то вернется 0, иначе все будет ок. return (int)@$a[1]; } function getYaRankRead($site) //win1251 // возвращает массив из 2х чисел - Рейтинг и Кол-во читателей по версии Яндекс - Блоги { $buf = file_get_contents("http://blogs.yandex.ru/top/?username=$site"); preg_match('!.*?(\d+)\n
(\d+)
\n!ism',$buf,$match); $rank = $reader = 0; if (!empty($match[1])) { $reader = $match[2]; } if (!empty($match[1])) { $rank = $match[1]; } return(array($rank,$reader)); } function getDMOZ($site) //utf-8 { // DMOZ // http://search.dmoz.org/cgi-bin/search?search=u:ngs.ru $buf = file_get_contents('http://search.dmoz.org/cgi-bin/search?search=u:'.$site); // results found if (preg_match('!results\sfound!ism',$buf)) { return(0); } else { return(1); } } ////////////////////////////////// function getYaCat($site) //utf-8 { // Я каталог // http://search.yaca.yandex.ru/yandsearch?text=url%3D%22blog.gtalex.ru*%22&rpt=rs2 $buf = utf8win1251(file_get_contents('http://search.yaca.yandex.ru/yandsearch?text=url%3D%22'.$site.'*%22&rpt=rs2')); // нигде не встречается if (preg_match('!нигде\sне\sвстречается!ism',$buf)) { return(0); } else { return(1); } } ////////////////////////////////// function getGoogleIdx($site) //utf-8 { // http://www.google.com/search?hl=en&q=site:blog.gtalex.ru $buf = file_get_contents('http://www.google.com/search?hl=en&q=site:'.$site); // of about 1,210,000 from if (preg_match('!of\sabout\s(.*?)\sfrom!ism',$buf,$match)) { return(str_replace(',','',$match[1])); } else { return(0); } } ////////////////////////////////// function getYandexIdx($site) // utf-8 { // http://yandex.ru/yandsearch?text=&site=ngs.ru&ras=1&site_manually=true $buf = utf8win1251(file_get_contents('http://yandex.ru/yandsearch?text=&site='.$site.'&ras=1&site_manually=true')); // нашлось 384 тыс. страниц // нашлось 182 страницы if (preg_match('!нашлось\s(\d+)\sстраниц!ism',$buf,$match)) { return($match[1]); } if (preg_match('!нашлось\s(\d+)\ \;тыс\.\sстраниц!ism',$buf,$match)) { return(1000*$match[1]); } return(0); } ////////////////////////////////// function getTIC($site) { $url = 'http://'.$site; $str=file('http://bar-navig.yandex.ru/u?ver=2&show=32&url='.$url); if ($str==false) { $ans=false; } else { $is_find=preg_match("/value=\"(.\d*)\"/", join("",$str), $tic); if ($is_find<1) { $ans=0; } else { $ans=$tic[1]; } } return $ans; } ////////////////////////////////// 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>2)&5; $new_i=$new_c1*256+$new_c2; if ($new_i==1025) $out_i=168; else if ($new_i==1105) $out_i=184; else $out_i=$new_i-848; $out.=chr($out_i); $byte2=false; } if (($i>>5)==6) { $c1=$i; $byte2=true; } } return $out; } ?>