line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::HTTP::Spore::Role::UserAgent; |
2
|
|
|
|
|
|
|
$Net::HTTP::Spore::Role::UserAgent::VERSION = '0.09'; |
3
|
|
|
|
|
|
|
# ABSTRACT: create UserAgent |
4
|
|
|
|
|
|
|
|
5
|
22
|
|
|
22
|
|
10187
|
use Moose::Role; |
|
22
|
|
|
|
|
47
|
|
|
22
|
|
|
|
|
155
|
|
6
|
22
|
|
|
22
|
|
116862
|
use LWP::UserAgent; |
|
22
|
|
|
|
|
495780
|
|
|
22
|
|
|
|
|
2234
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has api_useragent => ( |
9
|
|
|
|
|
|
|
is => 'rw', |
10
|
|
|
|
|
|
|
isa => 'LWP::UserAgent', |
11
|
|
|
|
|
|
|
lazy => 1, |
12
|
|
|
|
|
|
|
handles => [qw/request/], |
13
|
|
|
|
|
|
|
default => sub { |
14
|
|
|
|
|
|
|
my $self = shift; |
15
|
|
|
|
|
|
|
my $ua = LWP::UserAgent->new(); |
16
|
|
|
|
|
|
|
$ua->agent( "Net::HTTP::Spore v" . $Net::HTTP::Spore::VERSION . " (Perl)" ); |
17
|
|
|
|
|
|
|
$ua->env_proxy; |
18
|
|
|
|
|
|
|
$ua->max_redirect(0); |
19
|
|
|
|
|
|
|
return $ua; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding UTF-8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Net::HTTP::Spore::Role::UserAgent - create UserAgent |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 VERSION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
version 0.09 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 AUTHORS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=over 4 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item * |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Franck Cuny <franck.cuny@gmail.com> |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item * |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Ash Berlin <ash@cpan.org> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item * |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Ahmad Fatoum <athreef@cpan.org> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=back |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Linkfluence. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
62
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |