Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="">
- <input type="text" name="busca">
- <input type="submit" value="Buscar">
- </form>
- <?php
- if(isset($_GET['busca'])){
- $busca = str_replace(array(' '),'+',$_GET['busca']);
- //$google = 'https://www.google.com.br/search?q='.$busca.'+cartaz&hl=pt-BR&biw=1600&bih=744&tbas=0&site=imghp&tbs=imgo:1,isz:ex,iszw:1000,iszh:1383&tbm=isch&source=lnt#q='.$busca.'+cartaz&hl=pt-BR&tbas=0&tbs=imgo:1,iszw:1000,iszh:1383,isz:m&tbm=isch';
- $google = 'https://www.google.com.br/search?hl=pt-BR&site=imghp&tbm=isch&source=hp&biw=1600&bih=744&q='.$busca.'+cartaz&oq='.$busca.'+cartaz#hl=pt-BR&tbm=isch&q='.$busca.'+cartaz';
- echo $google . "<br>";
- $ch = curl_init();
- $timeout = 0;
- curl_setopt($ch, CURLOPT_URL, $google);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.1 Safari/537.11');
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- $conteudo = curl_exec ($ch);
- curl_close($ch);
- //echo $conteudo;
- preg_match_all('/data:image\/jpeg(.+)"]/', $conteudo, $imagens);
- //print_r ($imagens)
- echo '<img src="'.str_replace(array('\u003d','"]'),'',$imagens[0][8]).'">';
- unset($imagens);
- //$ImgDownUrl = str_replace(,/^data:image\/[^;]/, 'data:application/octet-stream');
- }
- ?>
Add Comment
Please, Sign In to add comment