blib/lib/Bot/IRC/X/WwwShorten.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 80.9% 17 / 21 CC 1 SCAR 1.9
CC
1
Cov
87%
__ANON__
2.0
init
1.1
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Bot::IRC::X::WwwShorten;
2 # ABSTRACT: Bot::IRC plugin for automatic URL shortening
3  
4 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use exact;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use WWW::Shorten qw( TinyURL makeashorterlink );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '1.07'; # VERSION
10  
11 1 ▶sub init {
Subroutine init: called CC=1 SCAR=0.6
Pod undocumented
12 1 my ($bot) = @_;
13  
14 $bot->hook(
15 {
16 to_me => 1,
17 text => qr/^tiny\s+(?<url>\S+)/i,
18 },
19 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 0 my ( $bot, $in, $m ) = @_;
21 0 $bot->reply_to( makeashorterlink( $m->{url} ) );
22 },
23 1 );
24  
25 1 $bot->helps( 'tiny' => 'Shorten URLs. Usage: <bot nick> tiny <url>.' );
26 }
27  
28 2 1;
29  
30 __END__
↑ Summary