UserAgent(3)

NAME
WWW::UserAgent - detect browser, operating system and more from the user agent string

SYNOPSIS

 use Lire::WWW::UserAgent;
 my $test_string = "Mozilla/5.0 (compatible; Konqueror/2.1.2; X11)";
 my $analyzer = new Lire::WWW::UserAgent();
 $analyzer->setUserAgent($test_string);
 print " Operating System      : " . $analyzer->getOS() . "\n";
 print " Browser               : " . $analyzer->getBrowser() . "\n";
 print "   using GUI language  : " . $analyzer->getLanguage() . "\n";
 print "   (opt) Web Robot name: " . $analyzer->getRobot() . "\n";
 %customBrowserHash = ("CustomWebBrowser" => "Custom Web Browser 2005");
 $analyzer->addBrowserHash(%testhash);
 $analyzer->addBrowser("LastMinuteBrowser", "Lastest Released LM Browser");

DESCRIPTION
This module offers an interface to databases with known browsers, operating systems and other information useful in analyzing user agent strings as found in Apache combined logfiles.

The default values used when no match can be found from the databases can be set using parameters:

    my $analyzer = new Lire::WWW::UserAgent( os_default       => "Unknown OS",
                                             robot_default    => "No Robot",
                                             language_default => "Unknown",
                                             browser_default  => "Unknown",
                                            );
Optionally, the user can add custom information to the database with the addX() and addXHash() functions, where X is the type of database.

This module is based on ideas as seen in AWStats.

SEE ALSO
RFC 1945 and RFC 2068, Mozilla's user-agent strings policy on http://www.mozilla.org/build/revised-user-agent-strings.html .

VERSION
$Id: UserAgent.pm,v 1.11 2002/05/01 20:24:22 vanbaal Exp $

COPYRIGHT
Copyright (C) 2001, 2002 Stichting LogReport Foundation LogReport@LogReport.org

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.

AUTHORS
Egon Willighagen <egonw@logreport.org> and Francis Lacoste <flacoste@logreport.org>