line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::WWW::Pastebin::Bot::Pastebot::Create; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
356564
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.003'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
11
|
use Carp; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
75
|
|
9
|
1
|
|
|
1
|
|
6
|
use POE; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
10
|
1
|
|
|
1
|
|
410
|
use base 'POE::Component::NonBlockingWrapper::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
11
|
1
|
|
|
1
|
|
14
|
use WWW::Pastebin::Bot::Pastebot::Create; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
362
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _methods_define { |
14
|
1
|
|
|
1
|
|
464
|
return ( paste => '_wheel_entry' ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub paste { |
18
|
0
|
|
|
0
|
1
|
|
$poe_kernel->post( shift->{session_id} => paste => @_ ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _check_args { |
22
|
0
|
|
|
0
|
|
|
my ( $self, $args_ref ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
0
|
|
|
|
exists $args_ref->{content} |
25
|
|
|
|
|
|
|
or carp "Missing `content` argument" |
26
|
|
|
|
|
|
|
and return; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _prepare_wheel { |
32
|
0
|
|
|
0
|
|
|
my $self = shift; |
33
|
0
|
0
|
|
|
|
|
$self->{obj} = WWW::Pastebin::Bot::Pastebot::Create->new( |
34
|
0
|
|
|
|
|
|
%{ $self->{obj_args} || {} } |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _process_request { |
39
|
0
|
|
|
0
|
|
|
my ( $self, $in_ref ) = @_; |
40
|
0
|
|
|
|
|
|
my @args = ( $in_ref->{content} ); |
41
|
0
|
|
|
|
|
|
for ( qw(channel nick summary) ) { |
42
|
0
|
0
|
|
|
|
|
exists $in_ref->{$_} |
43
|
|
|
|
|
|
|
and push @args, $_ => $in_ref->{$_}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $paster = $self->{obj}; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if ( exists $in_ref->{site} ) { |
49
|
0
|
|
|
|
|
|
$paster->site( $in_ref->{site} ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $response_ref = $paster->paste( @args ); |
53
|
0
|
0
|
|
|
|
|
if ( $response_ref ) { |
54
|
0
|
|
|
|
|
|
$in_ref->{uri} = $paster->uri; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
else { |
57
|
0
|
|
|
|
|
|
$in_ref->{error} = $paster->error; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |