Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: PHP  |  size: 1.90 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $domain = "com"; // co.uk .ca .es
  3. ini_set("memory_limit", "64M");
  4. set_time_limit(0);
  5. error_reporting(E_ALL ^ E_NOTICE);
  6. print "Extracting...\n";
  7. createFile("emails.txt");
  8. $i=0;
  9. $mailsFound=0;
  10. $fileLink = file("list.txt");
  11. $totalPages = count($fileLink);
  12. foreach($fileLink as $fileNr => $u)
  13. {
  14. $i++;
  15. $opf = fopen("tmps","w"); fwrite($opf,file_get_contents($u)); fclose($opf);
  16. system("fmt tmps | grep \"ebay.$domain\" >> tmp");
  17. $fl = file_get_contents("tmp");
  18. preg_match_all("{\b(http):[\w/#~:.?+=&%@!\-.:?\-] +?(?=[.:?\-]*[^\w/#~:.?+=&%@!\-.:?\-]|$)}x",$fl,$fll);
  19. foreach($fll[0] as $url) {
  20. $url =trim($url); $url = str_replace("&amp", "", $url); $url = str_replace("&quot", "", $url);
  21. if (preg_match("/ebay.$domain/i",$url)) {
  22. //system("curl $url -s -o \"tmp2\"");
  23. system("wget -q -O tmp2 $url");
  24. $mm = getMails("tmp2");
  25. foreach($mm[0] as $email) { $email = trim($email);
  26. if (checkIfLineExists($email, "emails.txt")==0) {
  27. $mailsFound++;
  28. $flct = fopen("emails.txt", "a"); fwrite($flct, $email."\r\n"); fclose($flct); } } } }
  29. system("rm -rf tmps tmp tmp2");
  30. flush();
  31. print "Pagina $i din $totalPages e gata -> Total: $mailsFound maile\r\n";
  32. }
  33. function checkIfLineExists($line, $in) { $inContents = implode('', file($in)); if (stripos($inContents, $line)!==false) { return true; } else { return false; }};
  34. function createFile($file) { if (!(file_exists($file))) { touch($file); }};
  35. function after ($this, $inthat) { if (!is_bool(strpos($inthat, $this))) return substr($inthat, strpos($inthat,$this)+strlen($this)); };
  36. function before ($this, $inthat){ return substr($inthat, 0, strpos($inthat, $this)); };
  37. function btwStr ($this, $that, $inthat){ return before($that, after($this, $inthat));};
  38. function getMails($from) { $fl = file_get_contents($from); preg_match_all("/([\s]*)([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*([ ]+|)@([ ]+|)([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,}))([\s]*)/i", $fl, $fll); return $fll; };
  39. ?>