| 1 | package Mojolicious::Command::nopaste::Service::mathbin; | ||||||||||||||||||
| 2 | 1 | ▶ | use Mojo::Base 'Mojolicious::Command::nopaste::Service'; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 3 | |||||||||||||||||||
| 4 | 1 | has description => "Post to mathb.in\n"; | |||||||||||||||||
| 5 | |||||||||||||||||||
| 6 | 0 | ▶ | sub paste { | ||||||||||||||||
|
Subroutine
paste: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||
| 7 | 0 | my $self = shift; | |||||||||||||||||
| 8 | |||||||||||||||||||
| 9 | 0 | my $name = $self->name; | |||||||||||||||||
| 10 | 0 | my $title = $self->desc; | |||||||||||||||||
| 11 | |||||||||||||||||||
| 12 | 0 | ▶ | my $tx = $self->ua->post( 'http://mathb.in' => form => { | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 13 | code => $self->text, | ||||||||||||||||||
| 14 | ( $name ? ( name => $name ) : () ), | ||||||||||||||||||
| 15 | secrecy => $self->private ? 'yes' : '', | ||||||||||||||||||
| 16 | ( $title ? ( title => $title ) : () ), | ||||||||||||||||||
| 17 | }); | ||||||||||||||||||
| 18 | |||||||||||||||||||
| 19 | 0 | ▶ | unless ($tx->res->is_success) { | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 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 | 1; | |||||||||||||||||
| 29 | |||||||||||||||||||