PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Technorati Cosmos

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Web Services
View previous topic :: View next topic  
Author Message
crohole



Joined: 22 Aug 2009
Posts: 1
Location: Indonesia

PostPosted: Sat Aug 22, 2009 10:48 am    Post subject: Technorati Cosmos Reply with quote

I has use this code :

Code:

<?
/**
* Uses the Services_Technorati package
*/
require_once 'Services/Technorati.php';
// Replace this with your API key
$myApiKey = 'b680ff4d82f7a63c4ef9dce939f407ca';
// 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('http://pear.php.net', $options);
// Display some basic information
print "Searching for blogs that link to http://pear.php.net\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";
print_r($result['document']['item']);
foreach ($result['document']['item'] as $link)
{
printf("Link on %s to %s\n",
$link['weblog']['name'],
$link['linkurl']);
}
?>


But, when I run it in my web browser, there is a bug like this :
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\pear\Technorati\tech.php on line 23

Please tell me how to fix it. Thank's
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Web Services All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement