Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- var cx = '018142920006574800951:fr9axkz5my0';
- var gcse = document.createElement('script');
- gcse.type = 'text/javascript';
- gcse.async = true;
- gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
- '//www.google.com/cse/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- </script>
- <?php
- function _curl($url,$post="",$usecookie = false,$_sock = false,$timeout = false,$ref = false,$header = false) {
- $ch = curl_init();
- if($post) {
- curl_setopt($ch, CURLOPT_POST ,1);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
- }
- if($header){
- curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
- }
- if($_sock){
- curl_setopt($ch, CURLOPT_PROXY, $_sock);
- curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- }
- if($timeout){
- curl_setopt($ch, CURLOPT_TIMEOUT,$timeout);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- }
- if($ref){
- curl_setopt($ch,CURLOPT_REFERER,$ref);
- }
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_COOKIE, $usecookie);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
- if ($usecookie) {
- //curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);
- }
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
- $result=curl_exec ($ch);
- curl_close ($ch);
- return $result;
- }
- $st=_curl('http://www.google.com/cse?cx=018142920006574800951:fr9axkz5my0&ie=UTF-8&q=iphone6', 'POST');
- preg_match_all('/data-ctorig="http:\/\/fptshop.com.vn\/[a-z-]{3,}\/[a-z-0-9]{3,}"/',$st, $arr);
- print_r($arr);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement