Kyberdigi Labs

Perl module HTTP::Browscap

by C. McCohy <mccohy@kyberdigi.cz>
Actual version: 1.1
The most simpliest way to identify a web browser en
Kyberdigi Labs
Projects
Browscap
Requirements
License
Download
Installation
Running
Demo
Known bugs
Changelog
Archive

Access counter
Counter

Perl module HTTP::Browscap

This module provides an object HTTP::Browscap, which can get as much information about web browser comparing its User-Agent identification to a special database in browscap.ini file. If calling a Perl script via CGI, th browser identification string can be found in environmental variable $ENV{'HTTP_USER_AGENT}.


Requirements

You need two things to let this software run:

Note: The browscap.ini file will probably have about 100-300 kB.


License

This program is free soft, distribute it and/or modify it under the terms as Perl itself.


Download

You can download one simple tarred and gziped archive via HTTP protocol from this page:

HTTP-Browscap-1.1.tar.gz

Size: 4933 bytes
MD5: d8fed1c66061a5ec1820360a0296ff0b


Installation

Follow these steps as the system superuser:

First, unpack the archive.

# tar xzf HTTP-Browscap-1.1.tar.gz
Directory HTTP-Browscap-1.1 should be created, enter it.
# cd HTTP-Browscap-1.1
Create the Makefile.
# perl Makefile.PL
Prepare the package for testing/installing.
# make
Make some usefull internal tests (optional step).
# make test
Install the package.
# make install
That's it. Package itself should be installed in proper Perl modules directory and a manpage should be installed too. You can now find all usefull information on this page, so run man HTTP::Browser if you want.

Note 1: This module is not listed in official CPAN list of Perl mdules, because there already exists a HTTP::Browscap module. Use whichever you want.

Note 2: This installation steps should work or any Linux/UNIX/*BSD systems. Since I do not know too much about other platforms, specially Microsoft platforms, I cannot give more information about installation on those.


Running

The package manpage contains all important informatoin about how to use it. HTML verison of this manpage is available.


Demo

We can demonstrate how this module works, if you visit our demo page. We use browscap.ini database from http://www.garykeith.com/browsers/downloads.asp and we offer you sources of the demo script.


Known bugs

Bad handling of regular expression in browser name
If there were some '+' characters in browser name in browscap.ini file, the running program could have died with some Perl syntax error or any similar error. This bug has been (probably) fixed in version 1.1. Please note, that there is a possibility that this bug will appear in next versions, because we simple cannot know before, which bad characters or sets of characters will appear in future versions of browscap.ini. Thank to Josh Rosenbaum for bugreport.

There are no other known bugs at this moment. If you know about any, just send me an e-mail.


Changelog

1.1 Mon Apr  5 16:42:56 2004

- added browser variables 'width', 'height' and 'javaappletsframes'
- bugfix: allow '+' in agent identification strings (this character
  is being replaced with a space, thanks to Josh Rosenbaum for
  bugreport)
- bugfix: allow spaces in variable names in browscap.ini
- bugfix: allow case insensitive variable names in browscap.ini
- fixed typo: in documentation in example $browser->{'browser'}
  says browser name, not prevoisly shown $browser->{'name'}
- update of module documentation
- change of project homepage in module documentation

1.0 Fri Apr 25 09:23:07 2003

- initial release

Archive

Valid HTML 4.01 Kyberdigi Labs