<?
/**
 * Topsy Feed Parser 
 * Yannick 10/31/10
 * Version 1.0
 *
 * @Array   All parameter should be passed in an array
 * Output is an array of objects
  */

function TopsyAPI($Keyword)
{
	###### INIT  #####
	$TopsyFeedUrl = "http://otter.topsy.com/search.json?q=".$Keyword."&apikey=663BC381EBE54C41B2AA1DFCDD08888B";

	###### CURL & PARSE XML #####
	$CurlData = array(	"url" => $TopsyFeedUrl,
						"timeout" => '5');
	
	$TopsyFeed = json_decode(curl_get_contents($CurlData));

	return $TopsyFeed->response->list;
}

function TopsyAPITrend()
{
	###### INIT  #####
	$TopsyFeedUrl = "http://otter.topsy.com/trending.json?apikey=663BC381EBE54C41B2AA1DFCDD08888B";

	###### CURL & PARSE XML #####
	$CurlData = array(	"url" => $TopsyFeedUrl,
						"timeout" => '5');
	
	$TopsyFeed = json_decode(curl_get_contents($CurlData));

	return $TopsyFeed->response->list;
}
?>