Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <script>
  2. (function() {
  3. var cx = '018142920006574800951:fr9axkz5my0';
  4. var gcse = document.createElement('script');
  5. gcse.type = 'text/javascript';
  6. gcse.async = true;
  7. gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
  8. '//www.google.com/cse/cse.js?cx=' + cx;
  9. var s = document.getElementsByTagName('script')[0];
  10. s.parentNode.insertBefore(gcse, s);
  11. })();
  12. </script>
  13. <?php
  14. function _curl($url,$post="",$usecookie = false,$_sock = false,$timeout = false,$ref = false,$header = false) {
  15. $ch = curl_init();
  16. if($post) {
  17. curl_setopt($ch, CURLOPT_POST ,1);
  18. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  19. }
  20. if($header){
  21. curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
  22. }
  23. if($_sock){
  24. curl_setopt($ch, CURLOPT_PROXY, $_sock);
  25. curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  26. }
  27. if($timeout){
  28. curl_setopt($ch, CURLOPT_TIMEOUT,$timeout);
  29. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  30. }
  31. if($ref){
  32. curl_setopt($ch,CURLOPT_REFERER,$ref);
  33. }
  34. curl_setopt($ch, CURLOPT_URL, $url);
  35. curl_setopt($ch, CURLOPT_COOKIE, $usecookie);
  36. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  37. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  38. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
  39. if ($usecookie) {
  40. //curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);
  41. curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie);
  42. }
  43. curl_setopt($ch, CURLOPT_HEADER, 1);
  44. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  45. curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
  46. $result=curl_exec ($ch);
  47. curl_close ($ch);
  48. return $result;
  49. }
  50. $st=_curl('http://www.google.com/cse?cx=018142920006574800951:fr9axkz5my0&ie=UTF-8&q=iphone6', 'POST');
  51. preg_match_all('/data-ctorig="http:\/\/fptshop.com.vn\/[a-z-]{3,}\/[a-z-0-9]{3,}"/',$st, $arr);
  52. print_r($arr);
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement