line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebCL; |
2
|
1
|
|
|
1
|
|
23945
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
197053
|
use HTTP::Request::Common qw/GET POST/; |
|
1
|
|
|
|
|
77724
|
|
|
1
|
|
|
|
|
300
|
|
5
|
1
|
|
|
1
|
|
1311
|
use HTTP::Cookies; |
|
1
|
|
|
|
|
19535
|
|
|
1
|
|
|
|
|
40
|
|
6
|
1
|
|
|
1
|
|
10
|
use base qw/LWP::UserAgent/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
579938
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new{ |
11
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
12
|
0
|
|
|
|
|
|
my $self = new LWP::UserAgent; |
13
|
0
|
|
|
|
|
|
$self->cookie_jar({}); |
14
|
0
|
|
|
|
|
|
$self->ssl_opts(verify_hostname => 0); |
15
|
0
|
|
|
|
|
|
return bless($self,$this); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub req{ |
19
|
0
|
|
|
0
|
0
|
|
my ($self,$m,$u,$d,$p) = @_; |
20
|
0
|
|
|
|
|
|
my $req; |
21
|
0
|
0
|
|
|
|
|
if($m =~ /GET/i){ |
|
|
0
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
$req = GET($u . '?' . join('&',map{$_ = $_ . '=' . $d->{$_};$_} keys %{$d})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
elsif($m =~ /POST/i){ |
25
|
0
|
|
|
|
|
|
$req = POST($u,$d); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else{ |
28
|
0
|
|
|
|
|
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if($p){ |
32
|
0
|
|
|
|
|
|
my $proxy = ''; |
33
|
0
|
0
|
|
|
|
|
if($p->{proxy_user}){ |
34
|
0
|
|
|
|
|
|
$proxy = $p->{proxy_user} . ':' . $p->{proxy_password} . '@'; |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
$proxy = 'http://' . $proxy . $p->{proxy_host} . ':' . $p->{proxy_port} . '/'; |
37
|
0
|
|
|
|
|
|
$self->proxy($p->{proxy_type},$proxy); |
38
|
|
|
|
|
|
|
} |
39
|
0
|
|
|
|
|
|
return $self->request($req); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |