Merged some nasty programs from softz.harvie.cz
[mirrors/Programs.git] / php / crawler / old / url2mail.phps
diff --git a/php/crawler/old/url2mail.phps b/php/crawler/old/url2mail.phps
new file mode 100755 (executable)
index 0000000..206f4b6
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/php
+<?php
+//HTML Mail parser 0.4
+//<-Harvie 2oo7
+/*
+ *This thing checks URLs from STDIN and printing found E-Mails to STDOUT.
+ *Use it well...
+ */
+ $in = fopen('php://stdin', 'r');
+ while(!feof($in)) {
+       $url = trim(fgets($in)); //echo($url); //Debug
+       $page = @file($url);
+       if(!$page) continue;
+       foreach($page as $line) {
+               if(!eregi('(mailto:|@)', $line)) continue;
+               $line = spliti('mailto:', $line);
+               array_shift($line);
+               foreach($line as $mail) {
+                       $mail = spliti('(<|>| |\?|")', htmlspecialchars_decode($mail));
+                       echo(trim($mail[0])."\n");
+               }
+       }
+ }
\ No newline at end of file
This page took 0.126584 seconds and 4 git commands to generate.