How get google search results url?
(I use Zend_Gdata_Gbase for get search google results and not DomDocument/htmlsimpleparser because its looks to me that Zend_Gdata_Gbase done specially for parsing google results. if I wrong in my selection, please write.)
My function to get google search results for 'yahoo' or other query search string: (the function get a feed that should have search result for word 'yahoo', but when i use prin_t($feed) I don't see url for each result)
<?php
function queryGoogleSearch($queryString='yahoo'){
$service = new Zend_Gdata_Gbase();
$query = $service->newSnippetQuery();
$query->setBq('['.$queryString.']');
$query->setOrderBy('modification_time');
$query->setSortOrder('descending');
$query->setMaxResults('4');
$feed = $service->getGbaseSnippetFeed($query);
return $feed;
}
print_r(queryGoogleSearch());
?>
I get 4 first url results (when I search manually in google):
www.yahoo.com, mail.yahoo.com, search.yahoo.com, maps.yahoo.com
But I can't find them when I print $feed variable.
Please what should i change or add inqueryGoogleSearch() function? (Or other better code)
Thanks