line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::ThrowAwayMail; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
40595
|
use Moo; |
|
2
|
|
|
|
|
22723
|
|
|
2
|
|
|
|
|
10
|
|
6
|
2
|
|
|
2
|
|
3197
|
use MooX::LazierAttributes; |
|
2
|
|
|
|
|
6316
|
|
|
2
|
|
|
|
|
10
|
|
7
|
2
|
|
|
2
|
|
1905
|
use Types::Standard qw/Object Str/; |
|
2
|
|
|
|
|
178091
|
|
|
2
|
|
|
|
|
26
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
2669
|
use HTTP::Tiny; |
|
2
|
|
|
|
|
80022
|
|
|
2
|
|
|
|
|
122
|
|
10
|
2
|
|
|
2
|
|
18
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
473
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
attributes ( |
13
|
|
|
|
|
|
|
tiny => [rw, Object, {lzy, default => sub {HTTP::Tiny->new}}], |
14
|
|
|
|
|
|
|
base_url => [Str, {lzy, default => 'https://throwawaymail.org/getalias/text'}], |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get { |
18
|
2
|
|
|
2
|
0
|
34
|
my $response = $_[0]->tiny->get($_[0]->base_url); |
19
|
2
|
100
|
|
|
|
191
|
$response->{success} and return $response; |
20
|
|
|
|
|
|
|
croak sprintf "something went terribly wrong status - %s - reason - %s", |
21
|
1
|
|
|
|
|
156
|
$response->{status}, $response->{reason}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_alias { |
25
|
2
|
|
|
2
|
1
|
2230
|
return $_[0]->get->{content}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |