load->library('yql_lib'); } function index() { echo '
';
print_r($this->yql_lib->test_query());
}
function search_twitter($term = '@kulor')
{
echo '';
$yql_query = 'select * from json where url="http://search.twitter.com/search.json?q=' . $term . '" and itemPath = "json.results"';
print_r($this->yql_lib->query($yql_query));
}
function search_flickr($term = 'kulor')
{
echo '';
$yql_query = 'select * from flickr.photos.search where text="' . $term . '" limit 10';
print_r($this->yql_lib->query($yql_query));
}
function search_yahoo($term = 'kulor')
{
echo '';
$yql_query = 'select title,abstract from search.web where query="' . $term . '"';
print_r($this->yql_lib->query($yql_query));
}
function search_wikipedia($term = 'open')
{
echo '';
$yql_query = 'select * from xml where url="http://en.wikipedia.org/w/api.php?action=opensearch&search=' . $term . '&format=xml" and itemPath = "SearchSuggestion.Section.Item"';
print_r($this->yql_lib->query($yql_query));
}
}