Codebase list libhttp-browserdetect-perl / debian/1.19-1
* New upstream release * debian/copyright: Update license information Angel Abad Contreras 13 years ago
14 changed file(s) with 95 addition(s) and 907 deletion(s). Raw diff Collapse all Expand all
1919 },
2020 'dist_abstract' => 'Determine Web browser, version, and platform from an HTTP user agent string',
2121 'dist_author' => [
22 'Lee Semel <lee@semel.net>',
23 'Peter Walsham',
2224 'Olaf Alders <olaf@wundercounter.com> (current maintainer)'
2325 ],
2426 'dist_name' => 'HTTP-BrowserDetect',
25 'dist_version' => '1.18',
27 'dist_version' => '1.19',
2628 'license' => 'perl',
2729 'module_name' => 'HTTP::BrowserDetect',
2830 'recommends' => {},
00 Revision history for Perl extension HTTP::BrowserDetect.
1
2 1.19 2010-09-24
3 - Added support for WebOS (Jesse Thompson) RT #61437
14
25 1.18 2010-09-06
36 - Added support for Netfront and Safari on Kindle
00
11 This is the Perl distribution HTTP-BrowserDetect.
22
3 ## Installation
3 Installing HTTP-BrowserDetect is straightforward.
44
5 HTTP-BrowserDetect installation is straightforward.
6 If your CPAN shell is set up, you should just be able to do
5 ## Installation with cpanm
6
7 If you have cpanm, you only need one line:
8
9 % cpanm HTTP::BrowserDetect
10
11 If you are installing into a system-wide directory, you may need to pass the
12 "-S" flag to cpanm, which uses sudo to install the module:
13
14 % cpanm -S HTTP::BrowserDetect
15
16 ## Installing with the CPAN shell
17
18 Alternatively, if your CPAN shell is set up, you should just be able to do:
719
820 % cpan HTTP::BrowserDetect
921
10 Download it, unpack it, then build it as per the usual:
22 ## Manual installation
23
24 As a last resort, you can manually install it. Download the tarball, untar it,
25 then build it:
1126
1227 % perl Makefile.PL
1328 % make && make test
1631
1732 % make install
1833
34 If you are installing into a system-wide directory, you may need to run:
35
36 % sudo make install
37
1938 ## Documentation
2039
21 HTTP-BrowserDetect documentation is available as in POD.
22 So you can do:
40 HTTP-BrowserDetect documentation is available as POD.
41 You can run perldoc from a shell to read the documentation:
2342
2443 % perldoc HTTP::BrowserDetect
25
26 to read the documentation with your favorite pager.
1010 lib/HTTP/BrowserDetect.pm
1111 t/01-detect.t
1212 t/author-critic.t
13 t/create_config.pl
1413 t/release-pod-coverage.t
1514 t/release-pod-syntax.t
1615 t/useragents.yaml
00 ---
11 abstract: 'Determine Web browser, version, and platform from an HTTP user agent string'
22 author:
3 - 'Lee Semel <lee@semel.net>'
4 - 'Peter Walsham'
35 - 'Olaf Alders <olaf@wundercounter.com> (current maintainer)'
46 build_requires:
57 Data::Dump: 0
1214 ExtUtils::MakeMaker: 6.31
1315 Module::Build: 0.3601
1416 dynamic_config: 0
15 generated_by: 'Dist::Zilla version 4.102221, CPAN::Meta::Converter version 2.102160'
17 generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
1618 license: perl
1719 meta-spec:
1820 url: http://module-build.sourceforge.net/META-spec-v1.4.html
2426 resources:
2527 bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTTP-BrowserDetect
2628 repository: http://github.com/oalders/http-browserdetect
27 version: 1.18
29 version: 1.19
99
1010 my %WriteMakefileArgs = (
1111 'ABSTRACT' => 'Determine Web browser, version, and platform from an HTTP user agent string',
12 'AUTHOR' => 'Olaf Alders <olaf@wundercounter.com> (current maintainer)',
12 'AUTHOR' => 'Lee Semel <lee@semel.net>, Peter Walsham, Olaf Alders <olaf@wundercounter.com> (current maintainer)',
1313 'BUILD_REQUIRES' => {
1414 'Data::Dump' => '0',
1515 'English' => '0',
3030 'Exporter' => '0',
3131 'vars' => '0'
3232 },
33 'VERSION' => '1.18',
33 'VERSION' => '1.19',
3434 'test' => {
3535 'TESTS' => 't/*.t'
3636 }
22 an HTTP user agent string
33
44 VERSION
5 version 1.18
5 version 1.19
66
77 SYNOPSIS
88 use HTTP::BrowserDetect;
8484
8585 device()
8686 Returns the method name of the actual hardware, if it can be detected.
87 Currently returns one of: blackberry, iphone, ipod or ipad Returns UNDEF
88 if no hardware can be detected
87 Currently returns one of: blackberry, webos, iphone, ipod or ipad
88 Returns UNDEF if no hardware can be detected
8989
9090 device_name()
9191 Returns a human formatted version of the hardware device name. These
274274 ipad
275275 kindle
276276 palm
277 webos
277278 wap
278279 psp
279280 ps3
418419 includes any changes you have made. Please contact me if you have any
419420 questions.
420421
421 AUTHOR
422 Olaf Alders <olaf@wundercounter.com> (current maintainer)
422 AUTHORS
423 * Lee Semel <lee@semel.net>
424
425 * Peter Walsham
426
427 * Olaf Alders <olaf@wundercounter.com> (current maintainer)
423428
424429 COPYRIGHT AND LICENSE
425430 This software is copyright (c) 2010 by Lee Semel.
0 libhttp-browserdetect-perl (1.19-1) unstable; urgency=low
1
2 * New upstream release
3 * debian/copyright: Update license information
4
5 -- Angel Abad <angelabad@gmail.com> Wed, 29 Sep 2010 11:25:24 +0200
6
07 libhttp-browserdetect-perl (1.18-1) unstable; urgency=low
18
29 * New upstream release.
1919 This program is free software; you can redistribute it and/or modify
2020 it under the terms of the Artistic License, which comes with Perl.
2121 .
22 On Debian systems, the complete text of the Artistic License
22 On Debian GNU/Linux systems, the complete text of the Artistic License
2323 can be found in `/usr/share/common-licenses/Artistic'.
2424
2525 License: GPL-1+
2828 the Free Software Foundation; either version 1, or (at your option)
2929 any later version.
3030 .
31 On Debian systems, the complete text of version 1 of the General
32 Public License can be found in `/usr/share/common-licenses/GPL-1'.
31 On Debian GNU/Linux systems, the complete text of version 1 of the
32 General Public License can be found in `/usr/share/common-licenses/GPL-1'.
00 name = HTTP-BrowserDetect
1 author = Lee Semel <lee@semel.net>
2 author = Peter Walsham
13 author = Olaf Alders <olaf@wundercounter.com> (current maintainer)
24 license = Perl_5
35 copyright_holder = Lee Semel
46 copyright_year = 2010
5 version = 1.18
7 version = 1.19
68 main_module = lib/HTTP/BrowserDetect.pm
79
810 [MetaResources]
00 use strict;
11 package HTTP::BrowserDetect;
22 BEGIN {
3 $HTTP::BrowserDetect::VERSION = '1.18';
3 $HTTP::BrowserDetect::VERSION = '1.19';
44 }
55
66 use vars qw(@ISA @EXPORT @EXPORT_OK @ALL_TESTS);
3636 palm audrey iopener
3737 wap blackberry iphone
3838 ipod ipad ps3
39 psp kindle
39 psp kindle webos
4040 );
4141
4242 # Browsers
450450
451451 $tests->{BLACKBERRY} = ( index( $ua, "blackberry" ) != -1 );
452452 $tests->{IPHONE} = ( index( $ua, "iphone" ) != -1 );
453 $tests->{WEBOS} = ( index( $ua, "webos" ) != -1 );
453454 $tests->{IPOD} = ( index( $ua, "ipod" ) != -1 );
454455 $tests->{IPAD} = ( index( $ua, "ipad" ) != -1 );
455456 $tests->{KINDLE} = ( index( $ua, "kindle" ) != -1 );
991992 my ( $self, $check ) = _self_or_default( @_ );
992993
993994 my @devices = qw(
994 blackberry iphone ipod ipad ps3 psp
995 blackberry iphone ipod ipad ps3 psp webos
995996 );
996997
997998 foreach my $device ( @devices ) {
10121013 ipad => 'iPad',
10131014 psp => 'Sony PlayStation Portable',
10141015 ps3 => 'Sony PlayStation 3',
1016 webos => 'webOS',
10151017 );
10161018
10171019 my $device = $self->device;
10771079
10781080 =head1 VERSION
10791081
1080 version 1.18
1082 version 1.19
10811083
10821084 =head1 SYNOPSIS
10831085
11631165 =head2 device()
11641166
11651167 Returns the method name of the actual hardware, if it can be detected.
1166 Currently returns one of: blackberry, iphone, ipod or ipad Returns UNDEF if
1168 Currently returns one of: blackberry, webos, iphone, ipod or ipad Returns UNDEF if
11671169 no hardware can be detected
11681170
11691171 =head2 device_name()
14071409
14081410 =head3 palm
14091411
1412 =head3 webos
1413
14101414 =head3 wap
14111415
14121416 =head3 psp
15741578 changes. Just edit t/useragents.yaml so that the test coverage includes any
15751579 changes you have made. Please contact me if you have any questions.
15761580
1577 =head1 AUTHOR
1581 =head1 AUTHORS
1582
1583 =over 4
1584
1585 =item *
1586
1587 Lee Semel <lee@semel.net>
1588
1589 =item *
1590
1591 Peter Walsham
1592
1593 =item *
15781594
15791595 Olaf Alders <olaf@wundercounter.com> (current maintainer)
1596
1597 =back
15801598
15811599 =head1 COPYRIGHT AND LICENSE
15821600
1515
1616 eval "use Test::Perl::Critic";
1717 plan skip_all => 'Test::Perl::Critic required to criticise code' if $@;
18 Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc";
1918 all_critic_ok();
+0
-877
t/create_config.pl less more
0 #!/usr/bin/perl
1
2 use strict;
3 use warnings;
4
5 use Data::Dump qw( dump );
6 use Test::More qw( no_plan );
7 require_ok('HTTP::BrowserDetect');
8
9 my @tests = (
10 [
11 "Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.5) Gecko/20031007 Firebird/0.7",
12 "0.7",
13 0,
14 0.7,
15 "Firefox",
16 "WinXP",
17 "1.5",
18 ["windows", "win32", "winnt", "winxp", "firefox", "gecko"],
19 ],
20 [
21 "Mozilla/1.1 (Windows 3.0; I)",
22 "1.1",
23 1,
24 "0.1",
25 "Netscape",
26 "Win3x",
27 undef,
28 ["netscape", "windows", "win3x", "win16"],
29 ],
30 [
31 "Mozilla/1.1 (Windows 3.1; I)",
32 "1.1",
33 1,
34 "0.1",
35 "Netscape",
36 "Win3x",
37 undef,
38 ["netscape", "windows", "win31", "win3x", "win16"],
39 ],
40 [
41 "Mozilla/2.0 (Win95; I)",
42 "2.0",
43 2,
44 0,
45 "Netscape",
46 "Win95",
47 undef,
48 ["netscape", "nav2", "windows", "win32", "win95"],
49 ],
50 [
51 "Mozilla/2.0 (compatible; MSIE 3.01; Windows 95)",
52 "3.01",
53 3,
54 .01,
55 "MSIE",
56 "Win95",
57 undef,
58 ["ie", "ie3", "windows", "win32", "win95"],
59 ],
60 [
61 "Mozilla/2.0 (compatible; MSIE 3.01; Windows NT)",
62 "3.01",
63 3,
64 .01,
65 "MSIE",
66 "WinNT",
67 undef,
68 ["ie", "ie3", "windows", "win32", "winnt"],
69 ],
70 [
71 "Mozilla/2.0 (compatible; MSIE 3.0; AOL 3.0; Windows 95)",
72 "3",
73 3,
74 0,
75 "AOL Browser",
76 "Win95",
77 undef,
78 ["ie", "ie3", "windows", "win32", "win95", "aol", "aol3"],
79 ],
80 [
81 "Mozilla/2.0 (compatible; MSIE 4.0; Windows 95)",
82 "4",
83 4,
84 0,
85 "MSIE",
86 "Win95",
87 undef,
88 ["ie", "ie4", "ie4up", "windows", "win32", "win95"],
89 ],
90 [
91 "Mozilla/3.0 (compatible; MSIE 4.0; Windows 95)",
92 "4.0",
93 4,
94 0,
95 "MSIE",
96 "Win95",
97 undef,
98 ["ie", "ie4", "ie4up", "windows", "win32", "win95"],
99 ],
100 [
101 "Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)",
102 "4.01",
103 4,
104 0.01,
105 "MSIE",
106 "Win95",
107 undef,
108 ["ie", "ie4", "ie4up", "windows", "win32", "win95"],
109 ],
110 [
111 "Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)",
112 "5.0",
113 5,
114 0,
115 "MSIE",
116 "WinNT",
117 undef,
118 ["ie", "ie5", "ie5up", "ie4up", "windows", "win32", "winnt"],
119 ],
120 [
121 "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)",
122 "5.5",
123 5,
124 0.5,
125 "MSIE",
126 "WinNT",
127 undef,
128 [
129 "ie",
130 "ie5",
131 "ie5up",
132 "ie55",
133 "ie55up",
134 "ie4up",
135 "windows",
136 "win32",
137 "winnt",
138 ],
139 ],
140 [
141 "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) via proxy gateway Something/1.23",
142 "5.5",
143 5,
144 0.5,
145 "MSIE",
146 "Win2k",
147 undef,
148 [
149 "ie",
150 "ie5",
151 "ie5up",
152 "ie55",
153 "ie55up",
154 "ie4up",
155 "windows",
156 "win32",
157 "winnt",
158 "win2k",
159 ],
160 ],
161 [
162 "Mozilla/3.0 (Macintosh; I; PPC)",
163 "3.0",
164 3,
165 0,
166 "Netscape",
167 "Mac",
168 undef,
169 ["netscape", "nav3", "mac", "macppc"],
170 ],
171 [
172 "Mozilla/4.0 (compatible; MSIE 5.0; Win32)",
173 "5.0",
174 5,
175 0,
176 "MSIE",
177 undef,
178 undef,
179 ["ie", "ie4up", "ie5", "ie5up", "windows", "win32"],
180 ],
181 [
182 "Mozilla/4.0 (compatible; Opera/3.0; Windows 4.10) 3.50",
183 "3.0",
184 3,
185 0,
186 "Opera",
187 undef,
188 undef,
189 ["opera", "opera3", "windows"],
190 ],
191 [
192 "Mozilla/4.0 (compatible; MSIE 5.0b1; Windows NT 5.0)",
193 "5.0",
194 5,
195 0,
196 "MSIE",
197 "Win2k",
198 undef,
199 [
200 "ie",
201 "ie4up",
202 "ie5",
203 "ie5up",
204 "windows",
205 "win32",
206 "winnt",
207 "win2k",
208 ],
209 ],
210 [
211 "Mozilla/4.06 [en] (Win98; I ;Nav)",
212 "4.06",
213 4,
214 0.06,
215 "Netscape",
216 "Win98",
217 undef,
218 ["netscape", "nav4", "nav4up", "windows", "win32", "win98"],
219 ],
220 [
221 "Mozilla/4.5 [en] (X11; I; FreeBSD 2.2.7-RELEASE i386)",
222 "4.5",
223 4,
224 0.5,
225 "Netscape",
226 "Unix",
227 undef,
228 [
229 "netscape",
230 "nav4",
231 "nav4up",
232 "nav45",
233 "nav45up",
234 "bsd",
235 "freebsd",
236 "unix",
237 "x11",
238 ],
239 ],
240 [
241 "Mozilla/3.03Gold (Win95; I)",
242 "3.03",
243 3,
244 0.03,
245 "Netscape",
246 "Win95",
247 undef,
248 ["netscape", "nav3", "navgold", "windows", "win32", "win95"],
249 ],
250 ["Wget/1.4.5", "1.4", 1, 0.4, undef, undef, undef, ["wget", "robot"]],
251 [
252 "libwww-perl/5.11",
253 "5.11",
254 5,
255 0.11,
256 undef,
257 undef,
258 undef,
259 ["lwp", "robot"],
260 ],
261 [
262 "GetRight/3.2.1",
263 "3.2",
264 3,
265 0.2,
266 undef,
267 undef,
268 undef,
269 ["getright", "robot"],
270 ],
271 [
272 "Mozilla/3.0 (compatible; StarOffice/5.1; Linux)",
273 "5.1",
274 5,
275 0.1,
276 undef,
277 "Linux",
278 undef,
279 ["linux", "unix", "staroffice"],
280 ],
281 [
282 "Mozilla/3.0 (compatible; StarOffice/5.1; Win32)",
283 "5.1",
284 5,
285 0.1,
286 undef,
287 undef,
288 undef,
289 ["win32", "windows", "staroffice"],
290 ],
291 [
292 "iCab/Pre2.0 (Macintosh; I; PPC)",
293 "2.0",
294 2,
295 0,
296 undef,
297 "Mac",
298 undef,
299 ["mac", "macppc", "icab"],
300 ],
301 [
302 "Konqueror/1.1.2",
303 "1.1",
304 1,
305 0.1,
306 undef,
307 undef,
308 undef,
309 [
310 "konqueror"
311 ],
312 [
313 "robot", # RT #30705
314 ],
315 ],
316 [
317 "Lotus-Notes/4.5 ( OS/2 )",
318 "4.5",
319 4,
320 0.5,
321 undef,
322 "OS2",
323 undef,
324 ["lotusnotes", "os2"],
325 ],
326 #["Java1.0.2", "0.0", 0, 0, undef, undef, undef, ["java"]],
327 [
328 "Googlebot/1.0 (googlebot\@googlebot.com http://googlebot.com/)",
329 "1.0",
330 1,
331 0,
332 undef,
333 undef,
334 undef,
335 ["google", "robot"],
336 ],
337 ["Nokia-WAP-Toolkit/1.3beta", "1.3", 1, 0.3, undef, undef, undef, ["wap"]],
338 ["Nokia7110/1.0 (30.05)", "1.0", 1, 0, undef, undef, undef, ["wap"]],
339 ["UP.Browser/4.1.2a-XXXX", "4.1", 4, 0.1, undef, undef, undef, ["wap"]],
340 ["Wapalizer/1.0", "1.0", 1, 0, undef, undef, undef, ["wap"]],
341 ["YourWap/1.16", "1.16", 1, 0.16, undef, undef, undef, ["wap"]],
342 [
343 "AmigaVoyager/3.3.50 (AmigaOS/PPC)",
344 "3.3",
345 3,
346 0.3,
347 undef,
348 undef,
349 undef,
350 ["amiga"],
351 ],
352 [
353 "fetch/1.0 FreeBSD/4.0-CURRENT (i386)",
354 "1.0",
355 1,
356 0,
357 undef,
358 "Unix",
359 undef,
360 ["bsd", "freebsd", "unix", "robot"],
361 ],
362 [
363 "Emacs-W3/2.1.105 URL/1.267 ((Unix?) ; TTY ; sparc-sun-solaris2.3)",
364 "2.1",
365 2,
366 0.1,
367 undef,
368 "Unix",
369 undef,
370 ["emacs", "sun", "unix"],
371 ],
372 [
373 "Mozilla/5.001 (windows; U; NT4.0; en-us) Gecko/25250101",
374 "5.001",
375 5,
376 0.001,
377 "Netscape",
378 "WinNT",
379 undef,
380 [
381 "netscape",
382 "nav4up",
383 "nav45up",
384 "windows",
385 "winnt",
386 "win32",
387 "gecko",
388 "nav6",
389 "nav6up",
390 "mozilla",
391 "gecko",
392 ],
393 ],
394 [
395 "Mozilla/5.001 (Macintosh; N; PPC; ja) Gecko/25250101 MegaCorpBrowser/1.0 (MegaCorp, Inc.)",
396 "5.001",
397 5,
398 0.001,
399 "Netscape",
400 "Mac",
401 undef,
402 [
403 "netscape",
404 "nav4up",
405 "nav45up",
406 "nav6",
407 "nav6up",
408 "mac",
409 "macppc",
410 "mozilla",
411 "gecko",
412 ],
413 ],
414 [
415 "Mozilla/9.876 (X11; U; Linux 2.2.12-20 i686, en) Gecko/25250101 Netscape/5.432b1 (C-MindSpring)",
416 "5.432",
417 5,
418 0.432,
419 "Netscape",
420 "Linux",
421 undef,
422 [
423 "netscape",
424 "nav4up",
425 "nav45up",
426 "nav6",
427 "nav6up",
428 "linux",
429 "unix",
430 "mozilla",
431 "gecko",
432 "x11",
433 ],
434 ],
435 [
436 "TinyBrowser/2.0 (TinyBrowser Comment) Gecko/20201231",
437 "2.0",
438 2,
439 0,
440 undef,
441 undef,
442 undef,
443 ["gecko"],
444 ],
445 [
446 "TinyBrowser/2.0 (TinyBrowser Comment) Gecko/20201231",
447 "2.000",
448 2,
449 0,
450 undef,
451 undef,
452 undef,
453 ["gecko"],
454 ],
455 [
456 "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040619 Firefox/0.9",
457 "0.9",
458 0,
459 0.9,
460 "Firefox",
461 "Unix",
462 "1.7",
463 ["unix", "freebsd", "bsd", "x11", "firefox", "gecko"],
464 ],
465 [
466 "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9",
467 "0.9",
468 0,
469 0.9,
470 "Firefox",
471 "WinXP",
472 "1.7",
473 ["windows", "win32", "winnt", "winxp", "firefox", "gecko"],
474 ],
475 [
476 "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a) Gecko/20040416 Firefox/0.8.0+",
477 "0.8",
478 0,
479 0.8,
480 "Firefox",
481 "Win2k",
482 "1.8a",
483 ["windows", "win32", "winnt", "win2k", "firefox", "gecko"],
484 ],
485 [
486 "Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.6) Gecko/20040207 Firefox/0.8",
487 "0.8",
488 0,
489 0.8,
490 "Firefox",
491 "Linux",
492 "1.6",
493 ["unix", "linux", "x11", "firefox", "gecko"],
494 ],
495 [
496 "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20031002 Mozilla Firebird/0.6.1",
497 "0.6",
498 0,
499 0.6,
500 "Firefox",
501 "Linux",
502 "1.5a",
503 ["unix", "linux", "x11", "firefox", "gecko"],
504 ],
505 [
506 "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5",
507 "0.5",
508 0,
509 0.5,
510 "Firefox",
511 "WinNT",
512 "1.3a",
513 ["windows", "win32", "winnt", "firefox", "gecko"],
514 ],
515 [
516 "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; OfficeLive",
517 "7.0",
518 7,
519 0,
520 "MSIE",
521 "WinVista",
522 undef,
523 [
524 "windows",
525 "win32",
526 "winnt",
527 "winvista",
528 "dotnet",
529 "ie",
530 "ie7",
531 "ie4up",
532 "ie5up",
533 "ie55up",
534 ],
535 ],
536 [
537 "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5",
538 "2.0",
539 2,
540 0,
541 "Chrome",
542 "WinVista",
543 undef,
544 [
545 "windows",
546 "win32",
547 "winnt",
548 "winvista",
549 "chrome",
550 ],
551 [
552 "safari",
553 "gecko",
554 ],
555 ],
556 # RT #48727
557 [
558 "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19.1",
559 "4.0",
560 4,
561 0,
562 "Safari",
563 "WinVista",
564 undef,
565 [
566 "windows",
567 "win32",
568 "winnt",
569 "winvista",
570 "safari",
571 ],
572 [
573 "gecko",
574 ],
575 ],
576 [
577 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1",
578 "1.25",
579 1,
580 0.25,
581 "Safari",
582 "Mac OS X",
583 undef,
584 [
585 "mac",
586 "macosx",
587 "macppc",
588 "safari",
589 ],
590 [
591 "gecko",
592 ],
593 ],
594 [
595 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/106.2 (KHTML, like Gecko) Safari/100.1",
596 "1.0",
597 1,
598 0,
599 "Safari",
600 "Mac OS X",
601 undef,
602 [
603 "mac",
604 "macosx",
605 "macppc",
606 "safari",
607 ],
608 [
609 "gecko",
610 ],
611 ],
612 [
613 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/74 (KHTML, like Gecko) Safari/74",
614 "0.74",
615 0,
616 0.74,
617 "Safari",
618 "Mac OS X",
619 undef,
620 [
621 "mac",
622 "macosx",
623 "macppc",
624 "safari",
625 ],
626 [
627 "gecko",
628 ],
629 ],
630 [
631 "BlackBerry7730/3.7.1 UP.Link/5.1.2.5",
632 "3.7",
633 3,
634 0.7,
635 undef,
636 undef,
637 undef,
638 ["blackberry"],
639 ],
640 [
641 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)",
642 "6.0",
643 6,
644 0,
645 "MSIE",
646 "Win2k",
647 undef,
648 [
649 "windows",
650 "winnt",
651 "win2k",
652 "win32",
653 "ie",
654 "ie4up",
655 "ie5up",
656 "ie55up",
657 "ie6",
658 "dotnet",
659 ],
660 ],
661 [
662 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
663 "6.0",
664 6,
665 0,
666 "MSIE",
667 "WinXP",
668 undef,
669 [
670 "windows",
671 "winnt",
672 "winxp",
673 "win32",
674 "ie",
675 "ie4up",
676 "ie5up",
677 "ie55up",
678 "ie6",
679 ],
680 ],
681 [
682 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
683 "6.0",
684 6,
685 0,
686 "MSIE",
687 "WinXP",
688 undef,
689 [
690 "windows",
691 "winnt",
692 "winxp",
693 "win32",
694 "ie",
695 "ie4up",
696 "ie5up",
697 "ie55up",
698 "ie6",
699 "dotnet",
700 ],
701 ],
702 [
703 "Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC) ",
704 "5.22",
705 5,
706 0.22,
707 "MSIE",
708 "Mac",
709 undef,
710 ["mac", "macppc", "ie", "ie4up", "ie5", "ie5up"],
711 ],
712 [
713 "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02",
714 "7.02",
715 7,
716 0.02,
717 "Netscape",
718 "Mac OS X",
719 "1.0.2",
720 [
721 "mac",
722 "macppc",
723 "netscape",
724 "nav4up",
725 "nav45up",
726 "nav6up",
727 "gecko",
728 "macosx",
729 "mozilla",
730 ],
731 ],
732 [
733 "Mozilla/5.0 (X11; U; Linux 2.4.3-20mdk i586; en-US; rv:0.9.1) Gecko/20010611",
734 "5",
735 5,
736 0,
737 "Netscape",
738 "Linux",
739 "0.9.1",
740 [
741 "linux",
742 "netscape",
743 "nav4up",
744 "nav45up",
745 "nav6",
746 "nav6up",
747 "unix",
748 "x11",
749 "gecko",
750 "mozilla",
751 ],
752 ],
753 [
754 "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.3.1.15.0",
755 4.13,
756 4,
757 0.13,
758 "Safari",
759 undef,
760 undef,
761 [
762 "safari",
763 ],
764 [
765 "gecko",
766 ],
767 ],
768 [
769 "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008062901 IceWeasel/3.0",
770 3.0,
771 3,
772 0,
773 "Iceweasel",
774 undef,
775 undef,
776 ["windows", "win32", "winnt", "winxp", "firefox", "gecko",],
777 ],
778 [
779 "libcurl-agent/1.0",
780 1,
781 1,
782 0,
783 "curl",
784 undef,
785 undef,
786 ["curl"],
787 ],
788 [
789 "puf/0.93.2a (Linux 2.4.20-19.9; i686)",
790 0.93,
791 0,
792 0.93,
793 "puf",
794 undef,
795 undef,
796 ["puf","robot",],
797 ["mobile",],
798 ],
799 [
800 "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5C1 Safari/525.20",
801 undef,
802 undef,
803 undef,
804 "safari",
805 undef,
806 undef,
807 ["safari", "mobile"],
808 ],
809 # test for uninitialized value warnings RT #8547
810 [
811 "Internetf Explorer 6 (MSIE 6; Windows XP)",
812 ],
813 # test for uninitialized value warnings RT #8547
814 [
815 "Links (2.1pre15; Linux 2.4.26-vc4 i586; x)",
816 ],
817
818 # These tests all have issues with returning undef rather than 0 for
819 # version numbers. Need to explore this to see what the correct behaviour
820 # should be
821
822 #[
823 # "AmigaVoyager (compatible; AmigaVoyager; AmigaOS)",
824 # "0.0",
825 # 0,
826 # 0,
827 # undef,
828 # undef,
829 # undef,
830 # ["amiga"],
831 #],
832 #[
833 # "AvantGo 3.2 (compatible; AvantGo 3.2)",
834 # "0.0",
835 # 0,
836 # 0,
837 # undef,
838 # undef,
839 # undef,
840 # ["palm", "avantgo"],
841 #],
842 #["Nothing", undef, undef, 0, undef, undef, undef, [""]], # does this make sense?
843 #[undef, "0.0", 0, 0, undef, undef, undef, [""]],
844 );
845
846
847 use YAML::Tiny qw( Dump DumpFile );
848
849 my $string = Dump( @tests );
850 #print $string;
851
852 my @yaml = ( );
853
854 foreach my $test ( @tests ) {
855 my ( $ua, $version, $major, $minor, $browser, $os, $other, $match, $no_match ) = @{$test};
856 my $desc = {
857 useragent => $ua,
858 version => $version,
859 major => $major,
860 minor => $minor,
861 browser => $browser,
862 os => $os,
863 other => $other,
864 match => $match,
865 no_match => $no_match,
866 };
867
868 push @yaml, $desc;
869
870 }
871
872 my $yaml = Dump ( @yaml );
873
874 print $yaml;
875
876 DumpFile( 'useragents.yaml', @yaml );
21472147 public_version: 4.0
21482148 public_major: 4
21492149 public_minor: 0
2150 ---
2151 useragent: 'Mozilla/5.0 (webOS/1.0; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0'
2152 language: EN
2153 country: US
2154 match:
2155 - safari
2156 - mobile
2157 - webos
2158 engine_string: KHTML
2159 device: webos
2160 device_name: webOS
21502161