scriptz-team

[PHP] GOOGLE SCRAPER v0.2

Jun 3rd, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <?php
  2. /*
  3. _____ _____ _ _____ _____ _____ _____ _____ _____
  4. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  5. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  6. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  7. |s C R i P T z - T E A M . i N F O|
  8.  
  9. Google scraper
  10.  
  11. WARN:
  12. GOOGLE MAY BAN YOUR iP!
  13.  
  14. USAGE:
  15. Just run :P
  16. */
  17. set_time_limit(0);
  18.  
  19. define("WTF", "powered by vbulletin"); //WTF = What To Find :D
  20. define("PN", "0"); //PG = Page Number
  21. define("ST", "5"); //ST = Sleep Time => The more, The better
  22.  
  23. function get_url($url)
  24. {
  25. $ch = curl_init();
  26. $user_agent = "[N.i.X]";
  27. curl_setopt($ch, CURLOPT_URL, $url);
  28. curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  29. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  30. $content = curl_exec($ch);
  31. curl_close($ch);
  32. return $content;
  33. }
  34.  
  35. function get_between($from, $to, $where, $position)
  36. {
  37. $x = explode($from, $where);
  38. $x = explode($to, $x[$position]);
  39. $x_ = $x[0];
  40. return $x_;
  41. }
  42.  
  43. for ($i = 1; $i <= 10; $i++) {
  44. $url = get_between('<h3 class="r"><a href="/url?q=', '&amp;', get_url("http://www.google.ca/search?q=".urlencode(WTF)."&hl=en&ie=UTF-8&prmd=xXx&ei=xXx&start=".PN."&sa=N"), $i);
  45. echo '<a href="' . $url . '">' . $url . '</a><br /><br />';
  46. sleep(ST);
  47. }
  48. ?>
Add Comment
Please, Sign In to add comment