H4T3D

Extract Emails From Websites

Dec 17th, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <head>
  2. <title>Extract Emails From Websites</title>
  3. <style>
  4. html, body {
  5.        background-color:#000000;
  6.        color:#00FF00;
  7.        font-family:monospace;
  8.        height: 100%;
  9.        text-decoration:  none;
  10. }
  11.  
  12.  
  13. textarea,input {
  14.        resize:none;
  15.        color: #1975FF ;
  16.        border:1px solid #1975FF ;
  17.        border-left: 4px solid #1975FF ;
  18. }
  19. input {
  20.        color: ##33CCFF;
  21.        border:1px dotted #33CCFF;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26.   <center> <br>
  27.   <h1>Extract Emails From Websites</h1>
  28.   </br>
  29.  
  30.       <form  method="post" action="">
  31.      <textarea name="urls" cols="111" rows="15" placeholder="Enter Url Line By Line"></textarea> <br>
  32.      <input type="submit" name="extract" value="Extract Emails only"/>
  33.       </form>
  34. <br>
  35.   </center>
  36. </body>
  37. </html>
  38. <?php
  39. set_time_limit(0);
  40. error_reporting(0);
  41.  
  42.   if(isset($_POST['extract'])){
  43.  
  44.     $url=explode("\n",$_POST['urls']);
  45.     foreach ($url as $key) {
  46.       $key=trim($key);
  47.  
  48.       if (false === strpos($key, '://')) {
  49.     $key = 'http://' . $key;
  50.     $homepage = file_get_contents($key);
  51.     }
  52.     else{
  53.       $homepage = file_get_contents($key);
  54.     }
  55.     preg_match_all('#[A-Z0-9a-z._%+-]+@[A-Za-z0-9.+-]+#',$homepage,$matches);
  56.     $h4t3d=array_unique($matches[0]);
  57.     foreach ($h4t3d as $ul){
  58.       static $counter;
  59.       $counter++;
  60.     echo $counter." , ".$ul."<br>";
  61.     flush();
  62.     @ob_flush();
  63.     }
  64.  
  65.  
  66.     }
  67.        
  68.  
  69.   }
  70.  
  71. ?>
Add Comment
Please, Sign In to add comment