Codebase list libhttp-browserdetect-perl / debian/1.12-1
* New upstream release. * debian/copyright: Refer to /usr/share/common-licenses/GPL-1. * Add build-dep on libmodule-build-perl (>= 0.360100). * Bump Standards-Version to 3.9.1. Ansgar Burchardt 13 years ago
18 changed file(s) with 818 addition(s) and 102 deletion(s). Raw diff Collapse all Expand all
0
01 use strict;
12 use warnings;
2 use Module::Build;
33
4 my $builder = Module::Build->new(
5 module_name => 'HTTP::BrowserDetect',
6 license => 'perl',
7 dist_author => q{Olaf Alders <olaf@wundercounter.com>},
8 dist_version_from => 'lib/HTTP/BrowserDetect.pm',
9 build_requires => {
10 'Data::Dump' => 0,
11 'Exporter' => 0,
12 'FindBin' => 0,
13 'Test::More' => 0,
14 'YAML::Tiny' => 0,
15 },
16 add_to_cleanup => [ 'HTTP-BrowserDetect-*' ],
17 create_makefile_pl => 'traditional',
4 use Module::Build 0.3601;
5
6
7 my %module_build_args = (
8 'build_requires' => {
9 'Data::Dump' => '0',
10 'English' => '0',
11 'FindBin' => '0',
12 'Module::Build' => '0.3601',
13 'Test::More' => '0',
14 'YAML::Tiny' => '0'
15 },
16 'configure_requires' => {
17 'ExtUtils::MakeMaker' => '6.31',
18 'Module::Build' => '0.3601'
19 },
20 'dist_abstract' => 'Determine Web browser, version, and platform from an HTTP user agent string',
21 'dist_author' => [
22 'Olaf Alders <olaf@wundercounter.com> (current maintainer)'
23 ],
24 'dist_name' => 'HTTP-BrowserDetect',
25 'dist_version' => '1.12',
26 'license' => 'perl',
27 'module_name' => 'HTTP::BrowserDetect',
28 'recommends' => {},
29 'recursive_test_files' => 1,
30 'requires' => {
31 'Exporter' => '0',
32 'vars' => '0'
33 },
34 'script_files' => []
1835 );
1936
20 $builder->create_build_script();
37
38 my $build = Module::Build->new(%module_build_args);
39
40 $build->create_build_script;
00 Revision history for Perl extension HTTP::BrowserDetect.
11
2 1.12 2010-08-01
3 - Added msn and msnmobile (Luke Saunders: f5c87a17b8fa2b09e294)
4 - Added googlemobile (Luke Saunders: ec28d49d7218b43788b9)
5 - SymbOS and Opera Mobi added to mobile detection (RT #59817)
6 - Distribution is now managed with Dist::Zilla
7
28 1.11 2010-06-03
39 - Added ps3 and psp (commit 85a619c9a977c0a8e403) (Alexey Surikov)
410
0
1 This is the Perl distribution HTTP-BrowserDetect.
2
3 Installing HTTP-BrowserDetect is straightforward.
4
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:
19
20 % cpan HTTP::BrowserDetect
21
22 ## Manual installation
23
24 As a last resort, you can manually install it. Download the tarball, untar it,
25 then build it:
26
27 % perl Makefile.PL
28 % make && make test
29
30 Then install it:
31
32 % make install
33
34 If you are installing into a system-wide directory, you may need to run:
35
36 % sudo make install
37
38 ## Documentation
39
40 HTTP-BrowserDetect documentation is available as POD.
41 You can run perldoc from a shell to read the documentation:
42
43 % perldoc HTTP::BrowserDetect
0 This software is copyright (c) 2010 by Lee Semel.
1
2 This is free software; you can redistribute it and/or modify it under
3 the same terms as the Perl 5 programming language system itself.
4
5 Terms of the Perl programming language system itself
6
7 a) the GNU General Public License as published by the Free
8 Software Foundation; either version 1, or (at your option) any
9 later version, or
10 b) the "Artistic License"
11
12 --- The GNU General Public License, Version 1, February 1989 ---
13
14 This software is Copyright (c) 2010 by Lee Semel.
15
16 This is free software, licensed under:
17
18 The GNU General Public License, Version 1, February 1989
19
20 GNU GENERAL PUBLIC LICENSE
21 Version 1, February 1989
22
23 Copyright (C) 1989 Free Software Foundation, Inc.
24 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
25 Everyone is permitted to copy and distribute verbatim copies
26 of this license document, but changing it is not allowed.
27
28 Preamble
29
30 The license agreements of most software companies try to keep users
31 at the mercy of those companies. By contrast, our General Public
32 License is intended to guarantee your freedom to share and change free
33 software--to make sure the software is free for all its users. The
34 General Public License applies to the Free Software Foundation's
35 software and to any other program whose authors commit to using it.
36 You can use it for your programs, too.
37
38 When we speak of free software, we are referring to freedom, not
39 price. Specifically, the General Public License is designed to make
40 sure that you have the freedom to give away or sell copies of free
41 software, that you receive source code or can get it if you want it,
42 that you can change the software or use pieces of it in new free
43 programs; and that you know you can do these things.
44
45 To protect your rights, we need to make restrictions that forbid
46 anyone to deny you these rights or to ask you to surrender the rights.
47 These restrictions translate to certain responsibilities for you if you
48 distribute copies of the software, or if you modify it.
49
50 For example, if you distribute copies of a such a program, whether
51 gratis or for a fee, you must give the recipients all the rights that
52 you have. You must make sure that they, too, receive or can get the
53 source code. And you must tell them their rights.
54
55 We protect your rights with two steps: (1) copyright the software, and
56 (2) offer you this license which gives you legal permission to copy,
57 distribute and/or modify the software.
58
59 Also, for each author's protection and ours, we want to make certain
60 that everyone understands that there is no warranty for this free
61 software. If the software is modified by someone else and passed on, we
62 want its recipients to know that what they have is not the original, so
63 that any problems introduced by others will not reflect on the original
64 authors' reputations.
65
66 The precise terms and conditions for copying, distribution and
67 modification follow.
68
69 GNU GENERAL PUBLIC LICENSE
70 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
71
72 0. This License Agreement applies to any program or other work which
73 contains a notice placed by the copyright holder saying it may be
74 distributed under the terms of this General Public License. The
75 "Program", below, refers to any such program or work, and a "work based
76 on the Program" means either the Program or any work containing the
77 Program or a portion of it, either verbatim or with modifications. Each
78 licensee is addressed as "you".
79
80 1. You may copy and distribute verbatim copies of the Program's source
81 code as you receive it, in any medium, provided that you conspicuously and
82 appropriately publish on each copy an appropriate copyright notice and
83 disclaimer of warranty; keep intact all the notices that refer to this
84 General Public License and to the absence of any warranty; and give any
85 other recipients of the Program a copy of this General Public License
86 along with the Program. You may charge a fee for the physical act of
87 transferring a copy.
88
89 2. You may modify your copy or copies of the Program or any portion of
90 it, and copy and distribute such modifications under the terms of Paragraph
91 1 above, provided that you also do the following:
92
93 a) cause the modified files to carry prominent notices stating that
94 you changed the files and the date of any change; and
95
96 b) cause the whole of any work that you distribute or publish, that
97 in whole or in part contains the Program or any part thereof, either
98 with or without modifications, to be licensed at no charge to all
99 third parties under the terms of this General Public License (except
100 that you may choose to grant warranty protection to some or all
101 third parties, at your option).
102
103 c) If the modified program normally reads commands interactively when
104 run, you must cause it, when started running for such interactive use
105 in the simplest and most usual way, to print or display an
106 announcement including an appropriate copyright notice and a notice
107 that there is no warranty (or else, saying that you provide a
108 warranty) and that users may redistribute the program under these
109 conditions, and telling the user how to view a copy of this General
110 Public License.
111
112 d) You may charge a fee for the physical act of transferring a
113 copy, and you may at your option offer warranty protection in
114 exchange for a fee.
115
116 Mere aggregation of another independent work with the Program (or its
117 derivative) on a volume of a storage or distribution medium does not bring
118 the other work under the scope of these terms.
119
120 3. You may copy and distribute the Program (or a portion or derivative of
121 it, under Paragraph 2) in object code or executable form under the terms of
122 Paragraphs 1 and 2 above provided that you also do one of the following:
123
124 a) accompany it with the complete corresponding machine-readable
125 source code, which must be distributed under the terms of
126 Paragraphs 1 and 2 above; or,
127
128 b) accompany it with a written offer, valid for at least three
129 years, to give any third party free (except for a nominal charge
130 for the cost of distribution) a complete machine-readable copy of the
131 corresponding source code, to be distributed under the terms of
132 Paragraphs 1 and 2 above; or,
133
134 c) accompany it with the information you received as to where the
135 corresponding source code may be obtained. (This alternative is
136 allowed only for noncommercial distribution and only if you
137 received the program in object code or executable form alone.)
138
139 Source code for a work means the preferred form of the work for making
140 modifications to it. For an executable file, complete source code means
141 all the source code for all modules it contains; but, as a special
142 exception, it need not include source code for modules which are standard
143 libraries that accompany the operating system on which the executable
144 file runs, or for standard header files or definitions files that
145 accompany that operating system.
146
147 4. You may not copy, modify, sublicense, distribute or transfer the
148 Program except as expressly provided under this General Public License.
149 Any attempt otherwise to copy, modify, sublicense, distribute or transfer
150 the Program is void, and will automatically terminate your rights to use
151 the Program under this License. However, parties who have received
152 copies, or rights to use copies, from you under this General Public
153 License will not have their licenses terminated so long as such parties
154 remain in full compliance.
155
156 5. By copying, distributing or modifying the Program (or any work based
157 on the Program) you indicate your acceptance of this license to do so,
158 and all its terms and conditions.
159
160 6. Each time you redistribute the Program (or any work based on the
161 Program), the recipient automatically receives a license from the original
162 licensor to copy, distribute or modify the Program subject to these
163 terms and conditions. You may not impose any further restrictions on the
164 recipients' exercise of the rights granted herein.
165
166 7. The Free Software Foundation may publish revised and/or new versions
167 of the General Public License from time to time. Such new versions will
168 be similar in spirit to the present version, but may differ in detail to
169 address new problems or concerns.
170
171 Each version is given a distinguishing version number. If the Program
172 specifies a version number of the license which applies to it and "any
173 later version", you have the option of following the terms and conditions
174 either of that version or of any later version published by the Free
175 Software Foundation. If the Program does not specify a version number of
176 the license, you may choose any version ever published by the Free Software
177 Foundation.
178
179 8. If you wish to incorporate parts of the Program into other free
180 programs whose distribution conditions are different, write to the author
181 to ask for permission. For software which is copyrighted by the Free
182 Software Foundation, write to the Free Software Foundation; we sometimes
183 make exceptions for this. Our decision will be guided by the two goals
184 of preserving the free status of all derivatives of our free software and
185 of promoting the sharing and reuse of software generally.
186
187 NO WARRANTY
188
189 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
190 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
191 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
192 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
193 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
194 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
195 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
196 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
197 REPAIR OR CORRECTION.
198
199 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
200 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
201 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
202 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
203 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
204 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
205 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
206 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
207 POSSIBILITY OF SUCH DAMAGES.
208
209 END OF TERMS AND CONDITIONS
210
211 Appendix: How to Apply These Terms to Your New Programs
212
213 If you develop a new program, and you want it to be of the greatest
214 possible use to humanity, the best way to achieve this is to make it
215 free software which everyone can redistribute and change under these
216 terms.
217
218 To do so, attach the following notices to the program. It is safest to
219 attach them to the start of each source file to most effectively convey
220 the exclusion of warranty; and each file should have at least the
221 "copyright" line and a pointer to where the full notice is found.
222
223 <one line to give the program's name and a brief idea of what it does.>
224 Copyright (C) 19yy <name of author>
225
226 This program is free software; you can redistribute it and/or modify
227 it under the terms of the GNU General Public License as published by
228 the Free Software Foundation; either version 1, or (at your option)
229 any later version.
230
231 This program is distributed in the hope that it will be useful,
232 but WITHOUT ANY WARRANTY; without even the implied warranty of
233 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
234 GNU General Public License for more details.
235
236 You should have received a copy of the GNU General Public License
237 along with this program; if not, write to the Free Software Foundation,
238 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
239
240 Also add information on how to contact you by electronic and paper mail.
241
242 If the program is interactive, make it output a short notice like this
243 when it starts in an interactive mode:
244
245 Gnomovision version 69, Copyright (C) 19xx name of author
246 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
247 This is free software, and you are welcome to redistribute it
248 under certain conditions; type `show c' for details.
249
250 The hypothetical commands `show w' and `show c' should show the
251 appropriate parts of the General Public License. Of course, the
252 commands you use may be called something other than `show w' and `show
253 c'; they could even be mouse-clicks or menu items--whatever suits your
254 program.
255
256 You should also get your employer (if you work as a programmer) or your
257 school, if any, to sign a "copyright disclaimer" for the program, if
258 necessary. Here a sample; alter the names:
259
260 Yoyodyne, Inc., hereby disclaims all copyright interest in the
261 program `Gnomovision' (a program to direct compilers to make passes
262 at assemblers) written by James Hacker.
263
264 <signature of Ty Coon>, 1 April 1989
265 Ty Coon, President of Vice
266
267 That's all there is to it!
268
269
270 --- The Artistic License 1.0 ---
271
272 This software is Copyright (c) 2010 by Lee Semel.
273
274 This is free software, licensed under:
275
276 The Artistic License 1.0
277
278 The Artistic License
279
280 Preamble
281
282 The intent of this document is to state the conditions under which a Package
283 may be copied, such that the Copyright Holder maintains some semblance of
284 artistic control over the development of the package, while giving the users of
285 the package the right to use and distribute the Package in a more-or-less
286 customary fashion, plus the right to make reasonable modifications.
287
288 Definitions:
289
290 - "Package" refers to the collection of files distributed by the Copyright
291 Holder, and derivatives of that collection of files created through
292 textual modification.
293 - "Standard Version" refers to such a Package if it has not been modified,
294 or has been modified in accordance with the wishes of the Copyright
295 Holder.
296 - "Copyright Holder" is whoever is named in the copyright or copyrights for
297 the package.
298 - "You" is you, if you're thinking about copying or distributing this Package.
299 - "Reasonable copying fee" is whatever you can justify on the basis of media
300 cost, duplication charges, time of people involved, and so on. (You will
301 not be required to justify it to the Copyright Holder, but only to the
302 computing community at large as a market that must bear the fee.)
303 - "Freely Available" means that no fee is charged for the item itself, though
304 there may be fees involved in handling the item. It also means that
305 recipients of the item may redistribute it under the same conditions they
306 received it.
307
308 1. You may make and give away verbatim copies of the source form of the
309 Standard Version of this Package without restriction, provided that you
310 duplicate all of the original copyright notices and associated disclaimers.
311
312 2. You may apply bug fixes, portability fixes and other modifications derived
313 from the Public Domain or from the Copyright Holder. A Package modified in such
314 a way shall still be considered the Standard Version.
315
316 3. You may otherwise modify your copy of this Package in any way, provided that
317 you insert a prominent notice in each changed file stating how and when you
318 changed that file, and provided that you do at least ONE of the following:
319
320 a) place your modifications in the Public Domain or otherwise make them
321 Freely Available, such as by posting said modifications to Usenet or an
322 equivalent medium, or placing the modifications on a major archive site
323 such as ftp.uu.net, or by allowing the Copyright Holder to include your
324 modifications in the Standard Version of the Package.
325
326 b) use the modified Package only within your corporation or organization.
327
328 c) rename any non-standard executables so the names do not conflict with
329 standard executables, which must also be provided, and provide a separate
330 manual page for each non-standard executable that clearly documents how it
331 differs from the Standard Version.
332
333 d) make other distribution arrangements with the Copyright Holder.
334
335 4. You may distribute the programs of this Package in object code or executable
336 form, provided that you do at least ONE of the following:
337
338 a) distribute a Standard Version of the executables and library files,
339 together with instructions (in the manual page or equivalent) on where to
340 get the Standard Version.
341
342 b) accompany the distribution with the machine-readable source of the Package
343 with your modifications.
344
345 c) accompany any non-standard executables with their corresponding Standard
346 Version executables, giving the non-standard executables non-standard
347 names, and clearly documenting the differences in manual pages (or
348 equivalent), together with instructions on where to get the Standard
349 Version.
350
351 d) make other distribution arrangements with the Copyright Holder.
352
353 5. You may charge a reasonable copying fee for any distribution of this
354 Package. You may charge any fee you choose for support of this Package. You
355 may not charge a fee for this Package itself. However, you may distribute this
356 Package in aggregate with other (possibly commercial) programs as part of a
357 larger (possibly commercial) software distribution provided that you do not
358 advertise this Package as a product of your own.
359
360 6. The scripts and library files supplied as input to or produced as output
361 from the programs of this Package do not automatically fall under the copyright
362 of this Package, but belong to whomever generated them, and may be sold
363 commercially, and may be aggregated with this Package.
364
365 7. C or perl subroutines supplied by you and linked into this Package shall not
366 be considered part of this Package.
367
368 8. The name of the Copyright Holder may not be used to endorse or promote
369 products derived from this software without specific prior written permission.
370
371 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
372 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
373 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
374
375 The End
376
0 Build.PL
1 Changes
2 lib/HTTP/BrowserDetect.pm
3 MANIFEST
4 README
5 t/01-detect.t
0 Build.PL
1 Changes
2 INSTALL
3 LICENSE
4 MANIFEST
5 META.yml
6 Makefile.PL
7 README
8 TODO
9 dist.ini
10 lib/HTTP/BrowserDetect.pm
11 t/01-detect.t
12 t/author-critic.t
13 t/release-pod-coverage.t
14 t/release-pod-syntax.t
615 t/useragents.yaml
7 Makefile.PL
8 META.yml
00 ---
11 abstract: 'Determine Web browser, version, and platform from an HTTP user agent string'
22 author:
3 - 'Olaf Alders <olaf@wundercounter.com>'
3 - 'Olaf Alders <olaf@wundercounter.com> (current maintainer)'
44 build_requires:
55 Data::Dump: 0
6 Exporter: 0
6 English: 0
77 FindBin: 0
8 Module::Build: 0.3601
89 Test::More: 0
910 YAML::Tiny: 0
1011 configure_requires:
11 Module::Build: 0.36
12 generated_by: 'Module::Build version 0.3603'
12 ExtUtils::MakeMaker: 6.31
13 Module::Build: 0.3601
14 dynamic_config: 0
15 generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
1316 license: perl
1417 meta-spec:
1518 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1619 version: 1.4
1720 name: HTTP-BrowserDetect
18 provides:
19 HTTP::BrowserDetect:
20 file: lib/HTTP/BrowserDetect.pm
21 version: 1.11
21 requires:
22 Exporter: 0
23 vars: 0
2224 resources:
23 license: http://dev.perl.org/licenses/
24 version: 1.11
25 bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTTP-BrowserDetect
26 repository: http://github.com/oalders/http-browserdetect
27 version: 1.12
0 # Note: this file was auto-generated by Module::Build::Compat version 0.3603
1 use ExtUtils::MakeMaker;
2 WriteMakefile
3 (
4 'NAME' => 'HTTP::BrowserDetect',
5 'VERSION_FROM' => 'lib/HTTP/BrowserDetect.pm',
6 'PREREQ_PM' => {
7 'Data::Dump' => 0,
8 'Exporter' => 0,
9 'FindBin' => 0,
10 'Test::More' => 0,
11 'YAML::Tiny' => 0
12 },
13 'INSTALLDIRS' => 'site',
14 'EXE_FILES' => [],
15 'PL_FILES' => {}
16 )
17 ;
0
1 use strict;
2 use warnings;
3
4
5
6 use ExtUtils::MakeMaker 6.31;
7
8
9
10 my %WriteMakefileArgs = (
11 'ABSTRACT' => 'Determine Web browser, version, and platform from an HTTP user agent string',
12 'AUTHOR' => 'Olaf Alders <olaf@wundercounter.com> (current maintainer)',
13 'BUILD_REQUIRES' => {
14 'Data::Dump' => '0',
15 'English' => '0',
16 'FindBin' => '0',
17 'Module::Build' => '0.3601',
18 'Test::More' => '0',
19 'YAML::Tiny' => '0'
20 },
21 'CONFIGURE_REQUIRES' => {
22 'ExtUtils::MakeMaker' => '6.31',
23 'Module::Build' => '0.3601'
24 },
25 'DISTNAME' => 'HTTP-BrowserDetect',
26 'EXE_FILES' => [],
27 'LICENSE' => 'perl',
28 'NAME' => 'HTTP::BrowserDetect',
29 'PREREQ_PM' => {
30 'Exporter' => '0',
31 'vars' => '0'
32 },
33 'VERSION' => '1.12',
34 'test' => {
35 'TESTS' => 't/*.t'
36 }
37 );
38
39
40 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
41 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
42 my $pp = $WriteMakefileArgs{PREREQ_PM};
43 for my $mod ( keys %$br ) {
44 if ( exists $pp->{$mod} ) {
45 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
46 }
47 else {
48 $pp->{$mod} = $br->{$mod};
49 }
50 }
51 }
52
53 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
54 unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
55
56 WriteMakefile(%WriteMakefileArgs);
57
58
59
22 an HTTP user agent string
33
44 VERSION
5 Version 1.07
5 version 1.12
66
77 SYNOPSIS
88 use HTTP::BrowserDetect;
99
10 my $browser = new HTTP::BrowserDetect($user_agent_string);
10 my $browser = HTTP::BrowserDetect->new($user_agent_string);
1111
1212 # Detect operating system
1313 if ($browser->windows) {
1414 if ($browser->winnt) ...
15 if ($brorwser->win95) ...
15 if ($browser->win95) ...
1616 }
1717 print $browser->mac;
1818
7272 log file, perhaps) without creating a new HTTP::BrowserDetect object
7373 each time.
7474
75 country()
76 Returns the country string as it may be found in the user agent string.
77 This will be in the form of an upper case 2 character code. ie: US, DE,
78 etc
79
7580 language()
7681 Returns the language string as it is found in the user agent string.
7782 This will be in the form of an upper case 2 character code. ie: EN, DE,
7883 etc
7984
80 country()
81 Returns the country string as it may be found in the user agent string.
82 This will be in the form of an upper case 2 character code. ie: US, DE,
83 etc
85 device()
86 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
89
90 device_name()
91 Returns a human formatted version of the hardware device name. These
92 names are subject to change and are really meant for display purposes.
93 You should use the device() method in your logic. Returns one of:
94 BlackBerry, iPhone, iPod or iPad. Returns UNDEF if no hardware can be
95 detected.
8496
8597 Detecting Browser Version
8698 Please note that that the version(), major() and minor() methods have
144156 engine_string()
145157 Returns one of the following:
146158
147 Gecko, KHTML, MSIE
159 Gecko, KHTML, MSIE, NetFront
148160
149161 Returns undef if no string can be found.
150162
187199
188200 vms()
189201 amiga()
202 ps3gameos()
203 pspgameos()
190204 It may not be possibile to detect Win98 in Netscape 4.x and earlier. On
191205 Opera 3.0, the userAgent string includes "Windows 95/NT4" on all Win32,
192206 so you can't distinguish between Win95 and WinNT.
196210 solely for compatibility with the HTTP::Headers::UserAgent module.
197211
198212 Win95, Win98, WinNT, Win2K, WinXP, Win2K3, WinVista, Win7, Mac, Mac OS X,
199 Win3x, OS2, Unix, Linux
213 Win3x, OS2, Unix, Linux, Playstation 3 GameOS, Playstation Portable GameOS
200214
201215 Detecting Browser Vendor
202216 The following methods are available, each returning a true or false
208222 mozilla
209223 firefox
210224 safari
211 crhome
225 chrome
212226 ie ie3 ie4 ie4up ie5 ie55 ie6 ie7 ie8
213227 neoplanet neoplanet2
214228 mosaic
224238 java
225239 curl
226240 realplayer
241 netfront
227242 Netscape 6, even though its called six, in the userAgent string has
228243 version number 5. The nav6 and nav6up methods correctly handle this
229244 quirk. The firefox text correctly detects the older-named versions of
256271 iopener
257272 iphone
258273 ipod
274 ipad
259275 palm
260276 wap
277 psp
278 ps3
261279 mobile()
262280 Returns true if the browser appears to belong to a handheld device.
263281
280298 linkexchange
281299 slurp
282300 google
301 googlemobile
302 msn (same as bing)
283303 puf
284 AUTHOR
304 CREDITS
285305 Lee Semel, lee@semel.net (Original Author)
286306
287307 Peter Walsham (co-maintainer)
320340 Marc Sebastian Pelzer
321341
322342 Alexey Surikov
343
344 Maros Kollar
345
346 Jay Rifkin
347
348 Luke Saunders
323349
324350 TO DO
325351 The _engine() method currently only handles Gecko. It needs to be
372398 The biggest limitation at this point is the test suite, which really
373399 needs to have many more UserAgent strings to test against.
374400
375 Patches are certainly welcome, with many thanks to the many
401 Patches are certainly welcome, with many thanks for the excellent
376402 contributions which have already been received. The preferred method of
377403 patching would be to fork the GitHub repo and then send me a pull
378404 requests, but plain old patch files are also welcome.
379405
380 LICENSE AND COPYRIGHT
381 Copyright 1999-2010 Lee Semel. All rights reserved. This program is free
382 software; you can redistribute it and/or modify it under the same terms
383 as Perl itself.
384
406 AUTHOR
407 Olaf Alders <olaf@wundercounter.com> (current maintainer)
408
409 COPYRIGHT AND LICENSE
410 This software is copyright (c) 2010 by Lee Semel.
411
412 This is free software; you can redistribute it and/or modify it under
413 the same terms as the Perl 5 programming language system itself.
414
0 - Test script can be cleaned up quite a lot by using the match/no_match for
1 all boolean tests.
2 (Robin Smidsrød - 2009-10-20)
3
4 - Consider getting more UA strings from http://www.user-agents.org/.
5 (Robin Smidsrød - 2009-10-20)
0 libhttp-browserdetect-perl (1.12-1) unstable; urgency=low
1
2 * New upstream release.
3 * debian/copyright: Refer to /usr/share/common-licenses/GPL-1.
4 * Add build-dep on libmodule-build-perl (>= 0.360100).
5 * Bump Standards-Version to 3.9.1.
6
7 -- Ansgar Burchardt <ansgar@43-1.org> Tue, 03 Aug 2010 12:58:47 +0900
8
09 libhttp-browserdetect-perl (1.11-1) unstable; urgency=low
110
211 * New upstream release.
11 Section: perl
22 Priority: optional
33 Build-Depends: debhelper (>= 7.3.7~)
4 Build-Depends-Indep: perl, libyaml-tiny-perl, libdata-dump-perl
4 Build-Depends-Indep: perl, libyaml-tiny-perl, libdata-dump-perl,
5 libmodule-build-perl (>= 0.360100)
56 Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
67 Uploaders: gregor herrmann <gregoa@debian.org>, Jonathan Yu <jawnsy@cpan.org>,
78 Ansgar Burchardt <ansgar@43-1.org>
8 Standards-Version: 3.8.4
9 Standards-Version: 3.9.1
910 Homepage: http://search.cpan.org/dist/HTTP-BrowserDetect/
1011 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-browserdetect-perl/
1112 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libhttp-browserdetect-perl/
1717 it under the terms of the Artistic License, which comes with Perl.
1818 .
1919 On Debian GNU/Linux systems, the complete text of the Artistic License
20 can be found in `/usr/share/common-licenses/Artistic'
20 can be found in `/usr/share/common-licenses/Artistic'.
2121
2222 License: GPL-1+
2323 This program is free software; you can redistribute it and/or modify
2525 the Free Software Foundation; either version 1, or (at your option)
2626 any later version.
2727 .
28 On Debian GNU/Linux systems, the complete text of the GNU General
29 Public License can be found in `/usr/share/common-licenses/GPL'
28 On Debian GNU/Linux systems, the complete text of version 1 of the GNU
29 General Public License can be found in `/usr/share/common-licenses/GPL-1'.
0 name = HTTP-BrowserDetect
1 author = Olaf Alders <olaf@wundercounter.com> (current maintainer)
2 license = Perl_5
3 copyright_holder = Lee Semel
4 copyright_year = 2010
5 version = 1.12
6 main_module = lib/HTTP/BrowserDetect.pm
7
8 [MetaResources]
9 bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTTP-BrowserDetect
10 repository.url = http://github.com/oalders/http-browserdetect
11 repository.type = git
12
13 [@Classic]
14 [AutoPrereq]
15 [CriticTests]
16 [ReadmeFromPod]
17 [InstallGuide]
18 [ModuleBuild]
19 [PodWeaver]
20
0 use strict;
01 package HTTP::BrowserDetect;
1
2 use strict;
3 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK @ALL_TESTS);
2 BEGIN {
3 $HTTP::BrowserDetect::VERSION = '1.12';
4 }
5
6 use vars qw(@ISA @EXPORT @EXPORT_OK @ALL_TESTS);
47 require Exporter;
58
69 @ISA = qw(Exporter);
710 @EXPORT = qw();
811 @EXPORT_OK = qw();
9 $VERSION = '1.11';
1012
1113 # Operating Systems
1214 push @ALL_TESTS, qw(
6567 lwp webcrawler linkexchange
6668 slurp webtv staroffice
6769 lotusnotes konqueror icab
68 google java
70 google java googlemobile
71 msn msnmobile
6972 );
7073
7174 # Properties
144147 ( [^\s]* ) # Beta version string is up to next space
145148 }x
146149 );
150
147151
148152 # Firefox version
149153 if ($ua =~ m{
166170 if ($ua =~ m{
167171 compatible;
168172 \s*
169 \w* # Browser name
173 \w*
170174 [\s|\/]
171 [A-Za-z]* # Eat any letters before the major version
175 [A-Za-z\-\/]* # Eat any letters before the major version
172176 ( [^.]* ) # Major version number is everything before first dot
173177 \. # The first dot
174178 ( [\d]* ) # Minor version nnumber is digits after first dot
181185 $major = $1;
182186 $minor = $2;
183187 $beta = $3;
188
184189 }
185190
186191 $major = 0 if !$major;
349354 = ( index( $ua, "libwww-perl" ) != -1 || index( $ua, "lwp-" ) != -1 );
350355 $tests->{YAHOO} = ( index( $ua, "yahoo" ) != -1 );
351356 $tests->{GOOGLE} = ( index( $ua, "googlebot" ) != -1 );
357 $tests->{GOOGLEMOBILE} = ( index( $ua, "googlebot-mobile" ) != -1 );
358 $tests->{MSN} = ( (index( $ua, "msnbot" ) != -1 || index( $ua, "bingbot" )) != -1 );
359 $tests->{MSNMOBILE} = ( (index( $ua, "msnbot-mobile" ) != -1 || index( $ua, "bingbot-mobile" )) != -1 );
352360 $tests->{JAVA}
353361 = ( index( $ua, "java" ) != -1 || index( $ua, "jdk" ) != -1 );
354362 $tests->{ALTAVISTA} = ( index( $ua, "altavista" ) != -1 );
371379 || $tests->{LINKEXCHANGE}
372380 || $tests->{SLURP}
373381 || $tests->{GOOGLE}
382 || $tests->{GOOGLEMOBILE}
383 || $tests->{MSN}
384 || $tests->{MSNMOBILE}
374385 )
375386 || index( $ua, "bot" ) != -1
376387 || index( $ua, "spider" ) != -1
455466 || index( $ua, "samsung" ) != -1
456467 || index( $ua, "zetor" ) != -1
457468 || index( $ua, "android" ) != -1
469 || index( $ua, "symbos" ) != -1
470 || index( $ua, "opera mobi" ) != -1
458471 || $tests->{PSP}
459472 );
460473
986999
9871000 1;
9881001
989 __END__
1002
1003
1004 =pod
9901005
9911006 =head1 NAME
9921007
9941009
9951010 =head1 VERSION
9961011
997 Version 1.11
1012 version 1.12
9981013
9991014 =head1 SYNOPSIS
10001015
10011016 use HTTP::BrowserDetect;
10021017
1003 my $browser = new HTTP::BrowserDetect($user_agent_string);
1018 my $browser = HTTP::BrowserDetect->new($user_agent_string);
10041019
10051020 # Detect operating system
10061021 if ($browser->windows) {
10231038
10241039 # Process a different user agent string
10251040 $browser->user_agent($another_user_agent_string);
1026
1027
10281041
10291042 =head1 DESCRIPTION
10301043
11071120 numbers returned by public_version(), public_major() and public_minor() will
11081121 be what you are looking for.
11091122
1110
11111123 =head2 public_version()
11121124
11131125 Returns the browser version as a floating-point number.
11571169 returns true if equal to the beta version. If the beta starts with a dot, it
11581170 is thrown away.
11591171
1160
11611172 =head1 Detecting Rendering Engine
11621173
11631174 =head2 engine_string()
12871298 text correctly detects the older-named versions of the browser (Phoenix,
12881299 Firebird)
12891300
1290
12911301 =head2 browser_string()
12921302
12931303 Returns undef on failure. Otherwise returns one of the following:
13671377
13681378 =head3 google
13691379
1380 =head3 googlemobile
1381
1382 =head3 msn (same as bing)
1383
13701384 =head3 puf
13711385
1372
1373 =head1 AUTHOR
1386 =head1 CREDITS
13741387
13751388 Lee Semel, lee@semel.net (Original Author)
13761389
14151428 Maros Kollar
14161429
14171430 Jay Rifkin
1431
1432 Luke Saunders
14181433
14191434 =head1 TO DO
14201435
14421457
14431458 perldoc HTTP::BrowserDetect
14441459
1445
14461460 You can also look for information at:
14471461
14481462 =over 4
14741488 The biggest limitation at this point is the test suite, which really needs to
14751489 have many more UserAgent strings to test against.
14761490
1477 Patches are certainly welcome, with many thanks to the many contributions
1478 which have already been received. The preferred method of patching would be to
1479 fork the GitHub repo and then send me a pull requests, but plain old patch
1480 files are also welcome.
1481
1482 =head1 LICENSE AND COPYRIGHT
1483
1484 Copyright 1999-2010 Lee Semel. All rights reserved. This program is free
1485 software; you can redistribute it and/or modify it under the same terms as
1486 Perl itself.
1491 Patches are certainly welcome, with many thanks for the excellent
1492 contributions which have already been received. The preferred method of
1493 patching would be to fork the GitHub repo and then send me a pull requests,
1494 but plain old patch files are also welcome.
1495
1496 =head1 AUTHOR
1497
1498 Olaf Alders <olaf@wundercounter.com> (current maintainer)
1499
1500 =head1 COPYRIGHT AND LICENSE
1501
1502 This software is copyright (c) 2010 by Lee Semel.
1503
1504 This is free software; you can redistribute it and/or modify it under
1505 the same terms as the Perl 5 programming language system itself.
14871506
14881507 =cut
1508
1509
1510 __END__
1511
1512 # ABSTRACT: Determine Web browser, version, and platform from an HTTP user agent string
1513
0 #!perl
1
2 BEGIN {
3 unless ($ENV{AUTHOR_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for testing by the author');
6 }
7 }
8
9
10 use strict;
11 use warnings;
12
13 use Test::More;
14 use English qw(-no_match_vars);
15
16 eval "use Test::Perl::Critic";
17 plan skip_all => 'Test::Perl::Critic required to criticise code' if $@;
18 all_critic_ok();
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9
10 use Test::More;
11
12 eval "use Test::Pod::Coverage 1.08";
13 plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
14 if $@;
15
16 eval "use Pod::Coverage::TrustPod";
17 plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
18 if $@;
19
20 all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9 use Test::More;
10
11 eval "use Test::Pod 1.41";
12 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
13
14 all_pod_files_ok();
13861386 - netscape
13871387 engine_string: NetFront
13881388 device_name: Sony PlayStation 3
1389 ---
1390 browser_string: ~
1391 match:
1392 - googlemobile
1393 - google
1394 - robot
1395 no_match: ~
1396 os: ~
1397 other: ~
1398 useragent: 'ua=DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)'
1399 language: ~
1400 country: ~
1401 public_version: 2.1
1402 public_major: 2
1403 public_minor: .1
1404 version: 2.1
1405 major: 2
1406 minor: .1
1407 ---
1408 browser_string: ~
1409 match:
1410 - msn
1411 - robot
1412 no_match: ~
1413 os: ~
1414 other: ~
1415 useragent: 'msnbot/2.0b (+http://search.msn.com/msnbot.htm)'
1416 language: ~
1417 country: ~
1418 public_version: 2.0
1419 public_major: 2
1420 public_minor: 0
1421 version: 2.0
1422 major: 2
1423 minor: 0
1424 ---
1425 browser_string: ~
1426 match:
1427 - msn
1428 - msnmobile
1429 - robot
1430 no_match: ~
1431 os: ~
1432 other: ~
1433 useragent: 'T-mobile Dash Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; Smartphone; 320x240;) msnbot-mobile/1.1 (+http://search.msn.com/msnbot.htm)'
1434 language: ~
1435 country: ~
1436 public_version: 4.01
1437 public_major: 4
1438 public_minor: .01
1439 version: 4.01
1440 major: 4
1441 minor: .01
1442 ---
1443 browser_string: ~
1444 match:
1445 - opera
1446 - mobile
1447 no_match: ~
1448 os: ~
1449 other: ~
1450 useragent: 'Opera/9.80 (S60; SymbOS; Opera Mobi/320; U; sv) Presto/2.4.15 Version/10.00'
1451 language: ~
1452 country: ~
1453 public_version: 9.80
1454 public_major: 9.80
1455 public_minor: .0
1456 version: 9.80
1457 major: 9
1458 minor: .8