line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
59386
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
50
|
|
2
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
101
|
|
3
|
|
|
|
|
|
|
package App::Nopaste::Service::Mojopaste; |
4
|
|
|
|
|
|
|
# ABSTRACT: Service provider for mojopaste |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.012'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
396
|
use parent 'App::Nopaste::Service'; |
|
2
|
|
|
|
|
253
|
|
|
2
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
50
|
|
1
|
1
|
118
|
sub uri { $ENV{NOPASTE_MOJOPASTE_WEBPATH} || 'https://ssl.thorsen.pm/paste' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub fill_form { |
13
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
14
|
0
|
|
|
|
|
|
my $mech = shift; |
15
|
0
|
|
|
|
|
|
my %args = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Hack around bot protection |
18
|
0
|
|
|
|
|
|
my $form = $mech->form_number(1); |
19
|
0
|
|
|
|
|
|
my $action = $form->action; |
20
|
0
|
0
|
|
|
|
|
if ($action =~ m{/invalid$}) { |
21
|
0
|
|
|
|
|
|
$action =~ s{/invalid$}{}; |
22
|
0
|
|
|
|
|
|
$form->action($action); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$mech->submit_form( |
26
|
|
|
|
|
|
|
fields => { |
27
|
|
|
|
|
|
|
p => 1, |
28
|
|
|
|
|
|
|
paste => $args{text}, |
29
|
|
|
|
|
|
|
}, |
30
|
0
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub return { |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
my $mech = shift; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $link = $mech->uri(); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return (1, $link); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |