-
-
Save basdog22/218869 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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