Created
August 25, 2011 02:51
-
-
Save vivirenremoto/1169863 to your computer and use it in GitHub Desktop.
Search images from google
This file contains hidden or 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
function searchItemsGoogleImages($search, $limit = 'small'){ | |
// $limit (large = 8 results, small 4 results) | |
$url = 'http://www.google.com/uds/GimageSearch?lstkp=0&rsz=' . $limit . '&hl=es&source=gsc&gss=.com&sig=fd25df5f26208aec5fddcae8457d8888&q=' . urlencode( $search ) . '&gl=www.google.com&qid=1253a7f078d655e6e&key=notsupplied&v=1.0'; | |
$data = file_get_contents( $url ); | |
$json = json_decode( $data ); | |
return $json->responseData->results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment