
sleuth
Enthusiast
Nov 15, 2000, 11:39 AM
Post #2 of 2
(1011 views)
|
I thought this would be a usefull little script so I wrote one for your needs. Did you happen to get the other script working? Edit my post to cut & paste the following code. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl # Addy Seeker 1.0 # --- Author --- # # Sleuth # Contact: Sleuth@seeki.com # --- Copywrite --- # # GNU Public License # --- Installation --- # # Upload, chmod, configure variables accordingly # must be uploaded in ascii mode # You must have an ftp client, if you don't have one go to "http://www.kis21.com/~hdlim/" and click downloads at the left # Or, search for "best ftp" at tucows.com and you can get the same one, it's a very good ftp client. # --- Notes --- # # Requested by benjaminlawrie at the perlguru.com forums # Please visit perlguru.com for all of your perl needs & questions # Perldomain.com coming soon as of now, great scripts done professionally and custom programming will be available # ---- End --- # print "Content-type: text/html\n\n"; $htmlfile = '/path/to/file.html'; # this is the file with the email addresses in it $done_file = '/path/to/donefile.db'; # this is the file it will save the addys to, it must exist. $append = "1"; # if this is 1 it will write the email addresses to the end of the $done_file, if it's nothing & just blank, # it will overwrite the file everytime with the email addresses it finds from $htmllfile. open(data, "<$htmlfile"); while(<data> ){ if ($_ =~ m,(\s.*?\@.*?\..+?\s), | | $_ =~ m,(^.*?\@.*?\..+?\s),){ ($addy = $1) =~ s!^\s!!; push(@addys,"$addy\n"); } } close(data); if (!$append){ open(file, ">$done_file"); print file @addys; close(file); } else{ open(file, ">>$done_file"); print file @addys; close(file); } $count=@addys; print qq~<p algin="left"><font face="verdana" color="880000" size="2">Finished:<br>"$count" Email address found.</font></p>~; exit; </pre><HR></BLOCKQUOTE>
|