Woothee - multi-language user-agent strings parsers (perl implementation)
For Woothee, see https://github.com/woothee/woothee
use Woothee; Woothee->parse("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)"); # => {'name'=>"Internet Explorer", 'category'=>"pc", 'os'=>"Windows 7", 'version'=>"8.0", 'vendor'=>"Microsoft"} Woothee->is_crawler('Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'); # => 1
'Woothee' is user-agent string parser, returns just same result over multi-language by sharing same datasets and testsets over implementations of each languages.
'Woothee' have no instance methods.
Woothee->parse( $useragent ) :HashRef
Parse user-agent string and returns HashRef with keys 'name', 'category', 'os', 'version' and 'vendor'.
For unknown user-agent (or partially failed to parse), result hashref may have value 'UNKNOWN'.
Woothee->is_crawler( $useragent ) :Bool
Try to see $useragent's category is 'crawler' or not, by casual(fast) method. Minor case of crawler is not tested in this method. To check crawler strictly, use "Woothee->parse()->{category} eq 'crawler'".
TAGOMORI Satoshi <tagomoris {at} gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Woothee, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Woothee
CPAN shell
perl -MCPAN -e shell install Woothee
For more information on module installation, please visit the detailed CPAN module installation guide.