Gossamer Forum
Home : General : Perl Programming :

Submit Script...Urgent Help Me!

Quote Reply
Submit Script...Urgent Help Me!
I've modify this script to send my site in 16 engines. But i receive one error...

Please hel-me...

Code of script:

Quote:
#!/usr/local/bin/perl
use Socket;

$| = 1;


$mailprog = '/var/qmail/bin/qmail-inject';

$date = `/bin/date`; chop ($date);

$email = "lsaud\@manaus.br";

$spiderfile = "sites.txt";

$use_crontab = "off";


print "Content-Type: text/html\n\n";

if ($use_crontab ne "on") {
print "<HTML><HEAD></HEAD><BODY>\n";
print "<H2><B>$organization Search Engine Warrior</B></H2><BR>\n";
print "<HR><P>\n";
}

open (SPIDEROUTPUT, "$spiderfile");
@spiderlist=<SPIDEROUTPUT>;

foreach $url (@spiderlist) {
chomp ($url);

open (PAGE, ">>$url");
print PAGE " ";
close (PAGE);


&post_to_engines;
}

if ($use_crontab eq "on") {
print MAIL1 "\n";
print MAIL1 "\n";
print MAIL1 "End of Report\n";
close (MAIL1);
exit(0);
}

print "<P><HR><P>\n";
print "<CENTER><B>End of Report</B></CENTER>\n";
print "</BODY></HTML>\n";
exit(0);


sub post_to_engines {

if ($use_crontab eq "on") {

open (MAIL1, "|$mailprog -t $email");
print MAIL1 "TO: $organization <$email>\n";
print MAIL1 "FROM: $organization Search Engine Warrior <$email>\n";
print MAIL1 "SUBJECT: Post Results For $date\n";
print MAIL1 "\n";
print MAIL1 "\n";
print MAIL1 "URL $url was added to Northern Light.\n" if ((&northernlight) == 0);
print MAIL1 "URL $url was added to Answers.\n" if ((&answers) == 0);
print MAIL1 "URL $url was added to Yeehaa.\n" if ((&yeehaa) == 0);
print MAIL1 "URL $url was added to World Search Center.\n" if ((&wsc) == 0);
print MAIL1 "URL $url was added to Planet Search.\n" if ((&planet) == 0);
print MAIL1 "URL $url was added to AltaVista.\n" if ((&altavista) == 0);
print MAIL1 "URL $url was added to Webcrawler.\n" if ((&webcrawler) == 0);
print MAIL1 "URL $url was added to Lycos.\n" if ((&lycos) == 0);
print MAIL1 "URL $url was added to AOL Netfind.\n" if ((&aolnetfind) == 0);
print MAIL1 "URL $url was added to WWW Worm.\n" if ((&worm) == 0);
print MAIL1 "URL $url was added to Excite.\n" if ((&excite) == 0);
print MAIL1 "URL $url was added to What You Seek.\n" if ((&seek) == 0);
print MAIL1 "URL $url was added to HotBot.\n" if ((&hotbot) == 0);
print MAIL1 "URL $url was added to Infoseek.\n" if ((&infoseek) == 0);
print MAIL1 "URL $url was added to RadarUol.\n" if ((&radar) == 0);
print MAIL1 "URL $url was added to Go.com.\n" if ((&go) == 0);

}else{

print "URL $url was added to Northern Light.\n" if ((&northernlight) == 0);
print "URL $url was added to Answers.\n" if ((&answers) == 0);
print "URL $url was added to Yeehaa.\n" if ((&yeehaa) == 0);
print "URL $url was added to World Search Center.\n" if ((&wsc) == 0);
print "URL $url was added to Planet Search.\n" if ((&planet) == 0);
print "URL $url was added to AltaVista.<BR>\n" if ((&altavista) == 0);
print "URL $url was added to Webcrawler.<BR>\n" if ((&webcrawler) == 0);
print "URL $url was added to Lycos.<BR>\n" if ((&lycos) == 0);
print "URL $url was added to AOL Netfind.<BR>\n" if ((&aolnetfind) == 0);
print "URL $url was added to WWW Worm.<BR>\n" if ((&worm) == 0);
print "URL $url was added to Excite.<BR>\n" if ((&excite) == 0);
print "URL $url was added to What You Seek.<BR>\n" if ((&seek) == 0);
print "URL $url was added to HotBot.<BR>\n" if ((&hotbot) == 0);
print "URL $url was added to Infoseek.<BR>\n" if ((&infoseek) == 0);
print "URL $url was added to RadarUol.<BR>\n" if ((&radar) == 0);
print "URL $url was added to Go.com.<BR>\n" if ((&go) == 0);

}
}

#########################################################################
# Northern Light #
#########################################################################
sub northernlight {

$port = 80;
$remote = "www.northernlight.com";
$add="/cgi-bin/urlsubmit.pl?name=$name&page=$url&email=$email";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /Thank you/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Northern Light failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Northern Light failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Answers #
#########################################################################
sub answers {

$port = 80;
$remote = "www.anzwers.com.au";
$add="/cgi-bin/print_addurl.pl?url=$url&email=$email";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /to be crawled/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Answers failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Answers failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Yeehaa #
#########################################################################
sub yeehaa {

$port = 80;
$remote = "www.yeehaa.com";
$add="/doaddurl.asp?iurl=$url";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /Successfully added/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Yeehaa failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Yeehaa failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# World Search Center #
#########################################################################
sub wsc {

$port = 80;
$remote = "www.worldsearchcenter.com";
$add="/url_check.cfm?url=$url&email=$email";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /been indexed/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to World Search Center failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to World Search Center failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Planet Search #
#########################################################################
sub planet {

$port = 80;
$remote = "www.planetsearch.com";
$add="/?a=20&olda=0&url=$url";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /certain category/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Planet Search failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Planet Search failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Altavista #
#########################################################################
sub altavista {

$port = 80;
$remote = "add-url.altavista.digital.com";
$add="/cgi-bin/newurl?ad=1&q=$url";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /will be indexed/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Altavista failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Altavista failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# WebCrawler #
#########################################################################
sub webcrawler {

$port = 80;
$remote = "info.webcrawler.com";
$add="/cgi-bin/addURL.cgi?URLS=$url&action=add";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /was added to/)
}
close(SOCK);
if($success != 1 && $use_crontab ne "on") {
print "Addition to Webcrawler for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Webcrawler for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Lycos #
#########################################################################
sub lycos {

$port = 80;
$remote = "www.lycos.com";
$add="/cgi-bin/spider_now.pl?query=$url&email=$email&opt-in=on";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {

$success = 1 if ($_ =~ /will be indexed/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Lycos failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Lycos failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Aol NetFind #
#########################################################################
sub aolnetfind {

$port = 80;
$remote = "netfind.aol.com";

$add="/cgi/nfadd_url.cgi?look=netfind&url=$url&email=$email";

$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {

$success = 1 if ($_ =~ /thanks/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to AOLNetfind failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to AOLNetfind failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# Worm #
#########################################################################
sub worm {

$port = 80;
$remote = "www.goto.com";
$add="/p/addsite.mp?URL=$url&EMAIL=$email";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /URL Submitted/)

}
if($success != 1 && $use_crontab ne "on") {
print "Addition to \"WWW Worm\" failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to \"WWW Worm\" failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# Excite #
#########################################################################
sub excite {

$port = 80;
$remote = "www.excite.com";

$add="/cgi/info.cgi?url=$url&email=$email&look=excite";


$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /Thank you/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to Excite failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Excite failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# What you Seek #
#########################################################################
sub seek {

$port = 80;
$remote = "www.whatuseek.com";

$add="/cgi-bin/addurl?url=$url&email=$email&submit=Add+This+URL";

$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /Thank you/)

}
if($success != 1 && $use_crontab ne "on") {
print "Addition to \"What You Seek\" failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to \"What You Seek\" failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# HotBot #
#########################################################################
sub hotbot {

$port = 80;
$remote = "main.hotbot.com";

$add="/addurl2.html?newurl=$url&email=$email";

$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /Got it/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to HotBot failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to HotBot failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# Infoseek #
#########################################################################
sub infoseek {

$port = 80;
$remote = "www.infoseek.com";

$add="/AddURL/addurl?pg=URLAddurl.html&sv=IS&lk=noframes&nh=10&url=$url";


$submit = "GET $add HTTP/1.0\n\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);

$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /has been submitted/)
}
close(SOCK);

if($success != 1 && $use_crontab ne "on") {
print "Addition to Infoseek failed for unknown reason.<BR>\n";
return 1;
}
if($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Infoseek failed for unknown reason.<BR>\n";
return 1;
}
return 0;
}

#########################################################################
# RadarUol #
#########################################################################
sub radar {

$port = 80;
$remote = "www.radaruol.com.br";
$add="/index.asp?AU=$url&EM=$email";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /acrescentada ao nosso/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to RadarUol failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to RadarUol failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}

#########################################################################
# Go #
#########################################################################
sub go {

$port = 80;
$remote = "www.go.com";
$add="/AddUrl/AddingURL?sv=IS&lk=noframes&url=$url&CAT=Add/Update URL";
$submit = "GET $add HTTP/1.0\n\n";
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port specified." unless $port;
$iaddr = inet_aton($remote) &#0124; &#0124; die "Could not find host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) &#0124; &#0124; die "socket: $!";
connect(SOCK, $paddr) &#0124; &#0124; die "connect: $!";
send(SOCK,$submit,0);
while(<SOCK> ) {
$success = 1 if ($_ =~ /in Progress/)
}

if($success != 1 && $use_crontab ne "on") {
print "Addition to GO failed for unknown reason.<BR>\n";
return 1;
}elsif ($success != 1 && $use_crontab eq "on") {
print MAIL1 "Addition to Go failed for unknown reason.<BR>\n";
return 1;
}

return 0;
}


------------------
[]'s

Lucas Saud - #19815087









Subject Author Views Date
Thread Submit Script...Urgent Help Me! Lucas 3942 Apr 15, 1999, 3:29 PM
Post Re: Submit Script...Urgent Help Me!
Pasha 3844 Apr 15, 1999, 4:22 PM
Post Re: Submit Script...Urgent Help Me!
dahamsta 3845 Apr 15, 1999, 11:22 PM
Post Re: Submit Script...Urgent Help Me!
Lucas 3845 Apr 16, 1999, 5:32 AM
Post Re: Submit Script...Urgent Help Me!
Pasha 3858 Apr 17, 1999, 9:01 AM