blib/lib/App/Nopaste/Service/Madduck.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 35 CC 2 SCAR 11.0
CC
2
Cov
0%
return
6.0
BEGIN
2.0
uri
2.0
CRAP 3.0
1 use strict;
2 use warnings;
3 package App::Nopaste::Service::Madduck;
4 BEGIN {
5 $App::Nopaste::Service::Madduck::VERSION = '0.01';
6 }
7  
8 # ABSTRACT: Paste to the madduck.co.uk pastebin
9  
10 use base 'App::Nopaste::Service';
11  
12 sub uri { 'http://p.madduck.co.uk/pastes/add' }
13  
14 sub fill_form {
15 my $self = shift;
16 my $mech = shift;
17 my %args = @_;
18  
19 $mech->form_number(0);
20  
21 $mech->submit_form(
22 fields => {
23 'paste_contents' => $args{text},
24 'name' => ucfirst $args{nick},
25 },
26 );
27 }
28  
29 sub return {
30 my $self = shift;
31 my $mech = shift;
32  
33 my $url = $mech->uri;
34 return (0, "Could not construct paste link.") if !$url;
35 return (1, $url);
36 }
37  
38 =head1 NAME
39  
40 App::Nopaste::Service::Madduck - http://p.madduck.co.uk/
41  
42 =head1 VERSION
43  
44 version 0.01
45  
46 =cut
47  
48 1;