#!/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 DBusername DBlogin\n"; my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn, $user, $password) or die "can't connect to database"; my $drh = DBI->install_driver("mysql") or die "can't install mysql driver"; 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 => {}) or next; eval{$mech->get ($urlbase)} or next;#the bug's here 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; }