Click to See Complete Forum and Search --> : Bit of a Perl/Apache type query


bolty
04-06-2001, 10:17 AM
I want to know whether I can gleam another servers admin's email address within Perl.

E.g. grab the ServerAdmin variable.

I am writing a custom 404 handling CGI that will automatically email people who have linked to an invalid page in our site.

[ 06 April 2001: Message edited by: bolty ]

Golden_Eternity
04-07-2001, 04:53 PM
You could go off whois data, but if the link is from a user account, then you'd be mailing the wrong person.

If you check the referring page, you might find an email address, but it might not be for the right person... In fact, you might get tricked by some addys intentionally on the site to get grabbed by spam bots.

Fully automating this process is probably not going to work out the way you hope.

Fandelem
04-08-2001, 02:01 AM
webmaster@website.com usually is a safe bet ;o)

bolty
04-09-2001, 06:09 AM
One prob with that is that is how do I grab a domain out of someones page eg
www.dmu.ac.uk/dsdsfgdg/dsgdsgds (http://www.dmu.ac.uk/dsdsfgdg/dsgdsgds) to dmu.ac.uk

and www.harvard.edu (http://www.harvard.edu) to harvard.edu

and www.france.con.fr (http://www.france.con.fr) to france.con.fr through code. I know you just grab the first word after the tld (and possible sub tld).

would I need a lookup of all valid tld's with their possible sub domains?

e.g.

.co.uk
.ac.uk
.net.uk
.org.uk
.uk

etc

and if so where would I get such a list?

YaRness
04-09-2001, 11:23 AM
did you post about this in the programming forum? seems familiar.

for grabbing the foo.com out of http://foo.com/foo/bar/baz.html, all you hafta do is match the stuff between 'http://' and the first '/'. if you post (or resurrect a post about it) in the programming forum, i can help you figure out how to do that. or someone else could.

i'm guessing you are emailing webmaster@somesite.com where somesite.com is the referring page? never hurts to suggest in your 404 page that the person email the referring web site's admins as well as trying to follow up yourself on such things.