File Coverage

blib/lib/Duadua/Parser/Bot/Twitterbot.pm
Criterion Covered Total %
statement 13 13 100.0
branch 5 6 83.3
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Duadua::Parser::Bot::Twitterbot;
2 6     6   42 use strict;
  6         11  
  6         221  
3 6     6   31 use warnings;
  6         12  
  6         794  
4              
5             sub try {
6 218     218 1 478 my ($class, $d) = @_;
7              
8 218 100       421 if ( index($d->ua, 'Twitterbot/') > -1 ) {
9 2         8 my $h = {
10             name => 'Twitterbot',
11             is_bot => 1,
12             };
13 2 100       7 if ($d->opt_version) {
14 1         6 my ($version) = ($d->ua =~ m!/([\d.]+)!);
15 1 50       6 $h->{version} = $version if $version;
16             }
17              
18 2         16 return $h;
19             }
20             }
21              
22             1;
23              
24             __END__