mnem00 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my($database,$hostname,$port,$user,$password) = @ARGV; use WWW::Mechanize; use DBI; print"usage : xmlrpc.pl databaseName DBhostname DBportNumber DBusernam +e DBlogin\n"; my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn, $user, $password) or die "can't connect t +o database"; my $drh = DBI->install_driver("mysql") or die "can't install mysql dri +ver"; my @databases = DBI->data_sources("mysql"); my $sth = $dbh->prepare("select url,username,password from blogs where + type like \"%pattern%\";") or die ("\ncan't get rows"); $sth->execute(); my @row; while ( @row = $sth->fetchrow_array ) { print "@row\n"; my $urlbase = $row[0]; my $pwd = $row[2]; my $login = $row[1]; my $mech = WWW::Mechanize->new(cookie_jar => {}) o +r next; eval{$mech->get ($urlbase)} or next;#the bug's her +e eval{$mech->form_number(0)} or next; eval{$mech->set_fields(log=>$login,pwd=>$pwd)}or +next; eval{$mech->submit} or next; eval{$mech->form_number(0)}or next; eval{$mech->tick( "enable_xmlrpc", "1" )} or next; eval{$mech->submit} or next; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $mechanize->get($url) connexion timeout stalls my script
by zwon (Abbot) on Oct 26, 2009 at 19:13 UTC |