In short, I'm looking for a way to do this:
$results_array = google("search terms");
So, for example, if my search terms were "cat videos", my $ results_array [0] could be a Youtube URL, and $ results_array 1 might include Vimeo.
I have seen the Google Custom Search API, but they all require complex JSON, ATOM, REST, or some other kind of system that is too complex for what I'm trying to do.
Are there any simple solutions?
EDIT: I found it, thanks to another post
Thanks to this post, I was able to figure it out. In short, I just used the following:
$results = json_decode(file_get_contents(
'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q='.
urlencode($search)));
echo $results->responseData->results[$resultNumber]->url;
downvotes - , , , . JSON, . , , :
function google($query) {
$results = json_decode(file_get_contents(
'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q='.
urlencode($search)));
return $results->responseData->results
}