line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::ThrowAwayMail; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
32937
|
use Moo; |
|
2
|
|
|
|
|
20189
|
|
|
2
|
|
|
|
|
8
|
|
6
|
2
|
|
|
2
|
|
2698
|
use MooX::LazierAttributes; |
|
2
|
|
|
|
|
4432
|
|
|
2
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1212
|
use HTTP::Tiny; |
|
2
|
|
|
|
|
68749
|
|
|
2
|
|
|
|
|
73
|
|
9
|
2
|
|
|
2
|
|
12
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
253
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
attributes ( |
12
|
|
|
|
|
|
|
tiny => [rw, HTTP::Tiny->new(),{lzy}], |
13
|
|
|
|
|
|
|
base_url => [ro, 'https://throwawaymail.org/getalias/text', { lzy }], |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
1
|
|
|
1
|
0
|
19
|
my $response = $_[0]->tiny->get($_[0]->base_url); |
18
|
1
|
50
|
|
|
|
105
|
$response->{success} and return $response; |
19
|
0
|
|
|
|
|
0
|
croak "something went terribly wrong" . $response; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get_alias { |
23
|
1
|
|
|
1
|
1
|
1165
|
return $_[0]->get->{content}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |