#!/usr/local/bin/perl -w use CGI; use LWP::UserAgent; use HTTP::Request; use HTTP::Status; use URI::URL; $| = 1; $debug = 0; $cgi = new CGI; #print $cgi->header; $input_url = $cgi->param('input_url'); $input_email = $cgi->param('input_email'); my $our_ip = "204.33.109.84"; if ($input_url !~ /^http:\/\//) { $output_string = "

Invalid URL

\n"; $output_string .= "

You input an invalid URL - try again!

"; &show_output ($output_string); exit; } if ($input_email !~ /@/) { $output_string = "

Invalid Email Address

\n"; $output_string .= "

You input an invalid email address - try again!

"; &show_output ($output_string); exit; } @site_list = qw (altavista excite hotbot lycos webcrawler); $altavista{"submission_page"} = "http://add-url.altavista.digital.com/cgi-bin/newurl"; $altavista{"method"} = "GET"; $altavista{"success"} = "has been recorded by our robot"; $altavista{"q"} = "$input_url"; $altavista{"ad"} = "1"; $excite{"submission_page"} = "http://www.excite.com/cgi/add_url_new.cgi"; $excite{"method"} = "GET"; $excite{"success"} = "Thank you!"; $excite{"url"} = "$input_url"; $excite{"email"} = "$input_email"; $excite{"look"} = "excite"; $hotbot{"submission_page"} = "http://www.hotbot.com/addurl.asp"; $hotbot{"method"} = "get"; $hotbot{"success"} = "Got it!"; $hotbot{"ip"} = "$our_ip"; $hotbot{"redirect"} = "http://www.hotbot.com/addurl2.html"; $hotbot{"newurl"} = "$input_url"; $hotbot{"email"} = "nobody\@internic.net"; $hotbot{"success_page"} = "http://www.hotbot.com/addurl.asp"; $lycos{"submission_page"} = "http://www.lycos.com/cgi-bin/spider_now.pl"; #$lycos{"submission_page"} = "http://smegma/~falcon/printenv.cgi"; $lycos{"method"} = "GET"; $lycos{"referer"} = "http://www.lycos.com/addasite.html"; $lycos{"success"} = "We successfully spidered your page."; $lycos{"query"} = "$input_url"; $lycos{"email"} = "$input_email"; $lycos{"opt-in"} = "off"; $webcrawler{"submission_page"} = "http://webcrawler.com/cgi-bin/addURL.cgi"; $webcrawler{"method"} = "POST"; $webcrawler{"success"} = "has been scheduled for indexing."; $webcrawler{"url"} = "$input_url"; $webcrawler{"action"} = "add"; my $ua = new LWP::UserAgent; $ua->agent ("ahref.com multisubmit 1.0"); $ua->from ("piou\@ahref.com"); $ua->timeout (90); print "
\n

Site Submitter Results

\n"; foreach $sitename (@site_list) { $query_string = $$sitename{submission_page} . "?"; if($$sitename{referer}) { $currentKeyNum = 4; } else { $currentKeyNum = 3; } $NumKeys = keys(%$sitename); foreach $key (keys %$sitename) { if (($key ne "submission_page") && ($key ne "success") && ($key ne "method") && ($key ne "referer")){ $query_string .= "$key=$$sitename{$key}"; unless ($currentKeyNum == ($NumKeys - 1)) { $query_string .= "&"; } $currentKeyNum++; } } $query_string = new URI::URL $query_string; my $request = new HTTP::Request "$$sitename{method}" => $query_string; if($$sitename{referer}) { $request->header('Referer' => "$$sitename{referer}"); } my $response = $ua->request ($request); $response_body = $response->content(); if (($response->code() == RC_OK) && ($response_body =~ /$$sitename{"success"}/)) { print "
Submission to $sitename was successful.\n
\n"; print "
$response_body

($currentKeyNum) : ($NumKeys)
($query_string)" if($debug); } else { $coder = $response->code(); print "
Submission to $sitename failed for some reason. "; print "(Response code $coder.) "; print $response_body if($debug); print "
($currentKeyNum) : ($NumKeys)
" . ($query_string) . "
$$sitename{method}
$$sitename{\"referer\"}" if($debug); print "
You will need to submit to $sitename by hand.\n
\n"; } } print "

All done.\n"; exit;