Skip to content

Instantly share code, notes, and snippets.

@vivirenremoto
Created August 25, 2011 02:51
Show Gist options
  • Save vivirenremoto/1169863 to your computer and use it in GitHub Desktop.
Save vivirenremoto/1169863 to your computer and use it in GitHub Desktop.
Search images from google
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