
August 25th, 2009, 10:25 AM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 1
Time spent in forums: 9 m 50 sec
Reputation Power: 0
|
|
Technorati Cosmos
I'am using technorati cosmos with HTTP_request, and XML_serializer.
I has a code like this :
PHP Code:
<?
/**
* Uses the Services_Technorati package
*/
require_once 'Services/Technorati.php';
// Replace this with your API key
$myApiKey = 'mykey';
// Create a new instance based on your key
$technorati = Services_Technorati::factory($myApiKey);
// Specify further options for the search
// We limit the result to ten links
$options = array('limit' => 10);
//Search blogs linking to the PEAR website
$result = $technorati->cosmos('myURL', $options);
// Display some basic information
print "Searching for blogs that link to My URL\n\n";
printf("Number of blogs found: %d\n", $result['document']['result']['inboundblogs']);
printf("Number of links found: %d\n", $result['document']['result']['inboundlinks']);
// Iterate through the found links
print "\nFirst ten links:\n\n";
foreach ($result['document']['item'] as $link)
{
printf("Link on %s to %s\n",
$link['weblog']['name'],
$link['linkurl']);
}
?>
That's the code to search all inbound links and blog But there is still a bug like this :
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\pear\Technorati\tech.php on line 22
Please tell me how to fix it. I has already install all needed packages.
|