Skip to content

Instantly share code, notes, and snippets.

@basdog22
Forked from sh1mmer/gist:218295
Created October 26, 2009 18:01
Show Gist options
  • Save basdog22/218869 to your computer and use it in GitHub Desktop.
Save basdog22/218869 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);
//What if we change the url to: http://query.yahooapis.com/v1/yql <-- this is for private data
//and do a query like: INSERT INTO meme.user.posts (type, content) VALUES ("text", "a text post test!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment