line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
933
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
3
|
|
|
|
|
|
|
package App::Nopaste::Service::Codepeek; |
4
|
|
|
|
|
|
|
# ABSTRACT: (DEPRECATED) Service for Codepeek - http://codepeek.com |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.011'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use parent 'App::Nopaste::Service'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
warnings::warnif('deprecated', 'codepeek.com is offline, so this service no longer works'); |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
1
|
|
sub uri { 'http://codepeek.com/paste' } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub fill_form { |
15
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $mech = shift; |
17
|
0
|
|
|
|
|
|
my %args = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$mech->form_number(1); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$mech->submit_form( |
22
|
|
|
|
|
|
|
fields => { |
23
|
|
|
|
|
|
|
'paste' => $args{text}, |
24
|
|
|
|
|
|
|
'language' => ucfirst $args{lang}, |
25
|
|
|
|
|
|
|
'privacy' => $args{private}, |
26
|
|
|
|
|
|
|
}, |
27
|
0
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub return { |
31
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
32
|
0
|
|
|
|
|
|
my $mech = shift; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $link = $mech->find_link( text_regex => qr#^http://codepeek.com/paste/[a-z0-9]+$#i ); |
35
|
0
|
|
|
|
|
|
my $url = $link->url; |
36
|
0
|
0
|
|
|
|
|
return (0, "Could not construct paste link.") if !$url; |
37
|
0
|
|
|
|
|
|
return (1, $url); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |