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   48 use strict;
  6         13  
  6         203  
3 6     6   38 use warnings;
  6         13  
  6         907  
4              
5             sub try {
6 219     219 1 458 my ($class, $d) = @_;
7              
8 219 100       437 if ( index($d->ua, 'Twitterbot/') > -1 ) {
9 2         10 my $h = {
10             name => 'Twitterbot',
11             is_bot => 1,
12             };
13 2 100       9 if ($d->opt_version) {
14 1         11 my ($version) = ($d->ua =~ m!/([\d.]+)!);
15 1 50       9 $h->{version} = $version if $version;
16             }
17              
18 2         11 return $h;
19             }
20             }
21              
22             1;
23              
24             __END__