• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/H03-May-2022-1,9781,470

t/H03-May-2022-1,8721,560

Build.PLH A D11-Apr-2019301 134

ChangesH A D11-Apr-20192.1 KiB8860

LICENSEH A D11-Apr-201918 KiB379292

MANIFESTH A D11-Apr-2019954 4545

META.jsonH A D11-Apr-20193 KiB117116

META.ymlH A D11-Apr-20191.8 KiB7271

MakefileH A D11-Apr-2019344 2014

README.mdH A D11-Apr-20191.9 KiB5129

cpanfileH A D11-Apr-2019170 107

minil.tomlH A D11-Apr-201976 53

README.md

1# NAME
2
3Woothee - multi-language user-agent strings parsers (perl implementation)
4
5For Woothee, see [https://github.com/woothee/woothee](https://github.com/woothee/woothee)
6
7# SYNOPSIS
8
9    use Woothee;
10
11    Woothee->parse("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)");
12    # => {'name'=>"Internet Explorer", 'category'=>"pc", 'os'=>"Windows 7", 'version'=>"8.0", 'vendor'=>"Microsoft"}
13
14    Woothee->is_crawler('Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
15    # => 1
16
17# DESCRIPTION
18
19'Woothee' is user-agent string parser, returns just same result over multi-language by sharing same datasets and testsets over implementations of each languages.
20
21# METHODS
22
23'Woothee' have no instance methods.
24
25## CLASS METHODS
26
27### `Woothee->parse( $useragent ) :HashRef`
28
29Parse user-agent string and returns HashRef with keys 'name', 'category', 'os', 'version' and 'vendor'.
30
31For unknown user-agent (or partially failed to parse), result hashref may have value 'UNKNOWN'.
32
33- 'category' is labels of user terminal type, one of 'pc', 'smartphone', 'mobilephone', 'appliance', 'crawler' or 'misc' (or 'UNKNOWN').
34- 'name' is the name of browser, like 'Internet Explorer', 'Firefox', 'GoogleBot'.
35- 'version' is version string, like '8.0' for IE, '9.0.1' for Firefix, '0.2.149.27' for Chrome, and so on.
36- 'os' is like 'Windows 7', 'Mac OSX', 'iPhone', 'iPad', 'Android'. This field used to indicate cellar phone carrier for category 'mobilephone'.
37- 'vendor' is optional field, shows browser vendor.
38
39### `Woothee->is_crawler( $useragent ) :Bool`
40
41Try 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'".
42
43# AUTHOR
44
45TAGOMORI Satoshi <tagomoris {at} gmail.com>
46
47# LICENSE
48
49This library is free software; you can redistribute it and/or modify
50it under the same terms as Perl itself.
51