| 1 | package Mojolicious::Command::nopaste::Service::shadowcat; | ||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Mojo::Base 'Mojolicious::Command::nopaste::Service'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||
| 4 | 1 | has description => "Post to paste.scsys.co.uk\n"; | |||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 1 | has irc_handled => 1; | |||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub paste { | ||||||||||||||||||||||||||||||
|
Subroutine
paste: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 9 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 10 | 0 | my $ua = $self->ua; | |||||||||||||||||||||||||||||||
| 11 | 0 | $ua->max_redirects(0); | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | my $tx = $ua->post( 'http://paste.scsys.co.uk/paste' => form => { | ||||||||||||||||||||||||||||||
|
Condition0%0/6
$self->channel || ''
$self->name || ''
$self->desc || ''
MC/DC0%0/1
$self->channel || ''
$self->channel
MC/DC0%0/1
$self->name || ''
$self->name
MC/DC0%0/1
$self->desc || ''
$self->desc
Truth table0%0/2
A
A= $self->channel
Truth table0%0/2
A
A= $self->name
Truth table0%0/2
A
A= $self->desc
| |||||||||||||||||||||||||||||||||
| 14 | channel => $self->channel || '', | ||||||||||||||||||||||||||||||||
| 15 | nick => $self->name || '', | ||||||||||||||||||||||||||||||||
| 16 | paste => $self->text, | ||||||||||||||||||||||||||||||||
| 17 | summary => $self->desc || '', | ||||||||||||||||||||||||||||||||
| 18 | }); | ||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | unless ($tx->res->is_success) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 21 | 0 | say $tx->res->message; | |||||||||||||||||||||||||||||||
| 22 | 0 | say $tx->res->body; | |||||||||||||||||||||||||||||||
| 23 | 0 | exit 1; | |||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | # <meta http-equiv="refresh" content="5;url=http://paste.scsys.co.uk/290870"> | ||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | 0 | my $redir = $tx->res->dom->at('meta[http-equiv="refresh"]')->{content}; | |||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | my $url = $1 if $redir =~ /url=(.*)/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | die "Could not find redirect url\n" unless $url; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||
| 33 | 0 | require Mojo::URL; | |||||||||||||||||||||||||||||||
| 34 | 0 | $url = Mojo::URL->new($url); | |||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | $url->query( hl => 'on' ) if $self->language eq 'perl'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | 0 | return $url; | |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | 1 | 1; | |||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||