line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Command::nopaste::Service::mathbin; |
2
|
1
|
|
|
1
|
|
590
|
use Mojo::Base 'Mojolicious::Command::nopaste::Service'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has description => "Post to mathb.in\n"; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub paste { |
7
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
my $name = $self->name; |
10
|
0
|
|
|
|
|
|
my $title = $self->desc; |
11
|
|
|
|
|
|
|
|
12
|
0
|
0
|
|
|
|
|
my $tx = $self->ua->post( 'http://mathb.in' => form => { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
13
|
|
|
|
|
|
|
code => $self->text, |
14
|
|
|
|
|
|
|
( $name ? ( name => $name ) : () ), |
15
|
|
|
|
|
|
|
secrecy => $self->private ? 'yes' : '', |
16
|
|
|
|
|
|
|
( $title ? ( title => $title ) : () ), |
17
|
|
|
|
|
|
|
}); |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
unless ($tx->res->is_status_class(200)) { |
20
|
0
|
|
|
|
|
|
say $tx->res->message; |
21
|
0
|
|
|
|
|
|
say $tx->res->body; |
22
|
0
|
|
|
|
|
|
exit 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return $tx->req->url; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|