То что ты используешь - сакс. на 64битках работать не будет. Используй отгрузку с тулбара...
PHP код:
<?php
/**
* Google Page rank data grabber.
* Based on Google toolbar data.
*
* Working with data like that:
* "Rank_1:1:6". Without XML/HTML parsing.
*
* @important:
* This code is for cognitive purposes only.
* Usage of this code is against Google's terms of service.
* No support is provided for this code.
* Can be used "as is" for your own risk.
*
* @requirements:
* - PHP version 5 (can easily be downgraded to PHP4)
* - cURL library (but you can replace curl functions with
* PHP standard fopen/fread or other)
*
* @version 1.1
* @author exstabler // PHP version
* @author snoopy // JS version
*
* @changelog:
* - 2007-01-18:
* 1. [exstabler] Deprecated method intToHex deleted.
* 2. [exstabler] Method toHex8 corrected.
*
* @sample usage:
* $obj = new PageRankGrabber();
* $rank = $obj->getRank('http://dir.org.ru');
*/
class PageRankGrabber {
/**
* Returns PageRank for specified page
* @param string $url
* @return integer PageRank value
*/
public function getRank($url) {
$pageUrl = $this->getRankUrlStingByPageUrl($url);
$content = $this->getContentCurl($pageUrl);
$parts = explode(":", $content);
return intval(@$parts[count($parts)-1]);
}
/**
* Returns content by URL with using
* cURL library.
*
* @param string $url
* @return string Site content
*/
public function getContentCurl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
/**
* The charCodeAt() method returns the Unicode
* of the character at a specified position.
*
* @param int $value
*/
private function charCodeAt($value, $position) {
$symbol = $value[$position];
// ord() is for ASCII!
// Original function should work with UTF-8.
return ord($symbol);
}