extracting mailto's
Otis Gospodnetic (otis@populus.net)
Mon, 12 Jan 1998 18:05:43 -0500
Hi,
I wrote a little robot using LWP some time ago and wanted to add the ability
to extract not only URLs but also mailto's (no, this is not for any kind of
email gathering crap, I hate that as much as everyone else).
So at one place in the code I have something like this:
foreach (HTML::LinkExtor->new->parse($webdoc->content)->eof->links) {
my($tag, %links) = @$_;
next unless $tag eq "a";
foreach $link (values %links) {
$link = url($link,$base)->abs->as_string;
my $u = new URI::URL($link);
if (lc($u->scheme) eq "mailto") {
# now how do I access the e-mail address after mailto: ?
# normally I can access $u->scheme, host, port, epath, etc.
but I can't figure out how to get the e-mail address.
}
....
}
}
Does anyone know how to do this?
Thanks
Otis