Skip to content

Instantly share code, notes, and snippets.

@sh1mmer
Created October 25, 2009 22:46
Show Gist options
  • Save sh1mmer/218295 to your computer and use it in GitHub Desktop.
Save sh1mmer/218295 to your computer and use it in GitHub Desktop.
$ch = curl_init();
$query = 'select * from search.web where query="pizza"';
$url = "http://query.yahooapis.com/v1/public/yql?q=" . urlencode($query) . "&diagnostics=false&env=store://datatables.org/alltableswithkeys&format=json";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment