[libhttp-browserdetect-perl] 01/03: Imported Upstream version 1.59
Angel Abad
angel at alioth.debian.org
Sun Aug 18 14:51:34 UTC 2013
This is an automated email from the git hooks/post-receive script.
angel pushed a commit to branch master
in repository libhttp-browserdetect-perl.
commit d9234e3c189d36ecff6b0e3119307db8f9a74c1a
Author: Angel Abad <angelabad at gmail.com>
Date: Sun Aug 18 16:38:50 2013 +0200
Imported Upstream version 1.59
---
Build.PL | 2 +-
Changes | 22 ++
META.json | 2 +-
Makefile.PL | 2 +-
README | 30 +--
dist.ini | 2 +-
lib/HTTP/BrowserDetect.pm | 647 +++++++++++++++++++++++++++------------------
t/01-detect.t | 16 +-
t/03-language.t | 6 +-
t/useragents.json | 66 ++++-
10 files changed, 499 insertions(+), 296 deletions(-)
diff --git a/Build.PL b/Build.PL
index 4f45303..9ff7f94 100644
--- a/Build.PL
+++ b/Build.PL
@@ -20,7 +20,7 @@ my %module_build_args = (
"Olaf Alders <olaf\@wundercounter.com> (current maintainer)"
],
"dist_name" => "HTTP-BrowserDetect",
- "dist_version" => "1.55",
+ "dist_version" => "1.59",
"license" => "perl",
"module_name" => "HTTP::BrowserDetect",
"recommends" => {},
diff --git a/Changes b/Changes
index 51e71dd..632581a 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,27 @@
Revision history for Perl extension HTTP::BrowserDetect.
+1.59 2013-08-18 00:38:21 America/Toronto
+ - Revert 1.57's behaviour of returning a robot name in browser_string.
+ - Fix bug where OS X identied as just Mac in os_string.
+ - Add linkchecker, YandexImages and archive.org_bot bots.
+ - Add undocumented os_version() for OS X, winPhone, Android, iOS, Firefox
+ OS.
+
+1.58 2013-08-16 23:37:23 America/Toronto
+ - Break up parsing into smaller chunks.
+ - Return better names for Googlebot News, Images and Video.
+ - Fix bug where Yahoo! Slurp reported as Firefox.
+
+1.57 2013-08-16 01:21:35 America/Toronto
+ - Make internals a little less quirky.
+ - Stop returning explicit undef for browser_string and os_string. (Why
+ would you ever call these in list context?)
+ - Return name of robot for browser_string when browser is, in fact, a bot.
+ Previous behaviour was to return undef or something just really wrong.
+
+1.56 2013-08-15 01:02:32 America/Toronto
+ - Adds experimental and undocumented robot_name method.
+
1.55 2013-07-22 23:06:40 America/Toronto
- Add all current Google robot user agents (Douglas Christopher Wilson)
diff --git a/META.json b/META.json
index 220bca1..20163e2 100644
--- a/META.json
+++ b/META.json
@@ -63,7 +63,7 @@
"web" : "https://github.com/oalders/http-browserdetect"
}
},
- "version" : "1.55",
+ "version" : "1.59",
"x_contributors" : [
"Aran Deltac <bluefeet at gmail.com>",
"Douglas Christopher Wilson <doug at somethingdoug.com>",
diff --git a/Makefile.PL b/Makefile.PL
index e5a0d70..6fd68d0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -36,7 +36,7 @@ my %WriteMakefileArgs = (
"Test::Most" => 0,
"Test::NoWarnings" => 0
},
- "VERSION" => "1.55",
+ "VERSION" => "1.59",
"test" => {
"TESTS" => "t/*.t"
}
diff --git a/README b/README
index d00809c..886a860 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ NAME
an HTTP user agent string
VERSION
- version 1.55
+ version 1.59
SYNOPSIS
use HTTP::BrowserDetect;
@@ -29,9 +29,6 @@ SYNOPSIS
...;
}
- # Process a different user agent string
- $browser->user_agent($another_user_agent_string);
-
DESCRIPTION
The HTTP::BrowserDetect object does a number of tests on an HTTP user
agent string. The results of these tests are available via methods of
@@ -55,12 +52,11 @@ CONSTRUCTOR AND STARTUP
scenes.
SUBROUTINES/METHODS
- user_agent($user_agent_string)
- Returns the value of the user agent string. When called with a
- parameter, it resets the user agent and reperforms all tests on the
- string. This way you can process a series of user agent strings (from a
- log file, perhaps) without creating a new HTTP::BrowserDetect object
- each time.
+ user_agent()
+ Returns the value of the user agent string.
+
+ Calling this method with a parameter has now been deprecated and this
+ feature will be removed in an upcoming release.
country()
Returns the country string as it may be found in the user agent string.
@@ -264,7 +260,7 @@ Detecting Browser Vendor
Netscape, Firefox, Safari, Chrome, MSIE, WebTV, AOL Browser, Opera,
Mosaic, Lynx, Links, ELinks, RealPlayer, IceWeasel, curl, puf, NetFront,
- Mobile Safari, BlackBerry
+ Mobile Safari, BlackBerry.
gecko_version()
If a Gecko rendering engine is used (as in Mozilla or Firefox), returns
@@ -419,20 +415,10 @@ TO DO
POD coverage is also not 100%.
SEE ALSO
- "The Ultimate JavaScript Client Sniffer, Version 3.0",
- <http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>
-
"Browser ID (User-Agent) Strings",
<http://www.zytrax.com/tech/web/browser_ids.htm>
- Safari "Historical User Agent strings",
- <http://developer.apple.com/internet/safari/uamatrix.html> (now gone,
- retrieved 2007-06-20)
-
- "Safari Agent Strings",
- <http://homepage.mac.com/jprince/designSandbox/web/safari-agents/>
-
- perl(1), HTTP::Headers, HTTP::Headers::UserAgent.
+ HTML::ParseBrowser.
SUPPORT
diff --git a/dist.ini b/dist.ini
index 70ebda3..73322c9 100644
--- a/dist.ini
+++ b/dist.ini
@@ -5,7 +5,7 @@ author = Olaf Alders <olaf at wundercounter.com> (current maintainer)
license = Perl_5
copyright_holder = Lee Semel
copyright_year = 2013
-version = 1.55
+version = 1.59
main_module = lib/HTTP/BrowserDetect.pm
[GatherDir]
diff --git a/lib/HTTP/BrowserDetect.pm b/lib/HTTP/BrowserDetect.pm
index 4529132..da7110b 100755
--- a/lib/HTTP/BrowserDetect.pm
+++ b/lib/HTTP/BrowserDetect.pm
@@ -3,7 +3,7 @@ use warnings;
package HTTP::BrowserDetect;
{
- $HTTP::BrowserDetect::VERSION = '1.55';
+ $HTTP::BrowserDetect::VERSION = '1.59';
}
use vars qw(@ALL_TESTS);
@@ -117,31 +117,73 @@ our @ENGINE_TESTS = qw(
gecko trident
);
+# https://support.google.com/webmasters/answer/1061943?hl=en
+
+my %ROBOTS = (
+ altavista => 'AltaVista',
+ askjeeves => 'AskJeeves',
+ baidu => 'Baidu Spider',
+ curl => 'curl',
+ facebook => 'Facebook',
+ getright => 'GetRight',
+ google => 'Google',
+ googleadsbot => 'Google AdsBot',
+ googleadsense => 'Google AdSense',
+ googlebotimage => 'Googlebot Images',
+ googlebotnews => 'Googlebot News',
+ googlebotvideo => 'Googlebot Video',
+ googlemobile => 'Google Mobile',
+ icab => 'iCab',
+ infoseek => 'InfoSeek',
+ linkchecker => 'LinkChecker',
+ linkexchange => 'LinkExchange',
+ lotusnotes => 'Lotus Notes',
+ lwp => 'LWP::UserAgent',
+ lycos => 'Lycos',
+ msn => 'MSN',
+ msnmobile => 'MSN Mobile',
+ puf => 'puf',
+ robot => 'robot',
+ slurp => 'Yahoo! Slurp',
+ specialarchiver => 'archive.org_bot',
+ staroffice => 'StarOffice',
+ webcrawler => 'WebCrawler',
+ webtv => 'WebTV',
+ wget => 'wget',
+ yahoo => 'Yahoo',
+ yandeximages => 'YandexImages',
+);
+
our @ROBOT_TESTS = qw(
puf curl wget
- getright robot yahoo
+ getright robot slurp
+ yahoo
altavista lycos infoseek
lwp webcrawler linkexchange
- slurp webtv staroffice
- lotusnotes icab google
- googlemobile msn msnmobile
+ webtv staroffice
+ lotusnotes icab googlemobile
+ msn msnmobile
facebook baidu googleadsbot
- askjeeves googleadsense
+ askjeeves googleadsense googlebotvideo
+ googlebotnews googlebotimage google
+ linkchecker yandeximages specialarchiver
);
our @MISC_TESTS = qw(
mobile dotnet x11
- java tablet
+ java tablet
);
push @ALL_TESTS,
(
- @OS_TESTS, @WINDOWS_TESTS, @MAC_TESTS,
- @UNIX_TESTS, @BSD_TESTS, @GAMING_TESTS,
- ( sort ( keys %DEVICE_TESTS ) ), @BROWSER_TESTS, @IE_TESTS,
- @OPERA_TESTS, @AOL_TESTS, @NETSCAPE_TESTS,
- @FIREFOX_TESTS, @ENGINE_TESTS, @ROBOT_TESTS,
- @MISC_TESTS,
+ @OS_TESTS, @WINDOWS_TESTS,
+ @MAC_TESTS, @UNIX_TESTS,
+ @BSD_TESTS, @GAMING_TESTS,
+ ( sort ( keys %DEVICE_TESTS ) ), @BROWSER_TESTS,
+ @IE_TESTS, @OPERA_TESTS,
+ @AOL_TESTS, @NETSCAPE_TESTS,
+ @FIREFOX_TESTS, @ENGINE_TESTS,
+ @ROBOT_TESTS, @MISC_TESTS,
);
# Safari build -> version map for versions prior to 3.0
@@ -228,6 +270,8 @@ sub _test {
$self->{tests} = {};
my $tests = $self->{tests};
+ $self->_os_tests;
+ $self->_robot_tests;
my @ff = ( 'firefox', @FIREFOX_TESTS );
my $ff = join "|", @ff;
@@ -267,10 +311,14 @@ sub _test {
# IE (and others) version
if ( $ua =~ m{\b msie \s ( [0-9\.]+ ) (?: [a-z]+ [a-z0-9]* )? ;}x ) {
+
# Internet Explorer
( $major, $minor, $beta ) = split /\./, $1;
}
- elsif ( $ua =~ m{\b compatible; \s* [\w\-]* / ( [0-9\.]* ) (?: [a-z]+ [a-z0-9\.]* )? ;}x ) {
+ elsif ( $ua
+ =~ m{\b compatible; \s* [\w\-]* / ( [0-9\.]* ) (?: [a-z]+ [a-z0-9\.]* )? ;}x
+ )
+ {
# Generic "compatible" formats
( $major, $minor, $beta ) = split /\./, $1;
@@ -445,7 +493,6 @@ sub _test {
# Other browsers
- $tests->{CURL} = ( index( $ua, "libcurl" ) != -1 );
$tests->{STAROFFICE} = ( index( $ua, "staroffice" ) != -1 );
$tests->{ICAB} = ( index( $ua, "icab" ) != -1 );
$tests->{LOTUSNOTES} = ( index( $ua, "lotus-notes" ) != -1 );
@@ -455,76 +502,11 @@ sub _test {
$tests->{ELINKS} = ( index( $ua, "elinks" ) != -1 );
$tests->{WEBTV} = ( index( $ua, "webtv" ) != -1 );
$tests->{MOSAIC} = ( index( $ua, "mosaic" ) != -1 );
- $tests->{PUF} = ( index( $ua, "puf/" ) != -1 );
- $tests->{WGET} = ( index( $ua, "wget" ) != -1 );
- $tests->{GETRIGHT} = ( index( $ua, "getright" ) != -1 );
- $tests->{LWP}
- = ( index( $ua, "libwww-perl" ) != -1 || index( $ua, "lwp-" ) != -1 );
- $tests->{YAHOO} = ( index( $ua, "yahoo" ) != -1 )
- && ( index( $ua, 'jp.co.yahoo.android' ) == -1 );
- $tests->{GOOGLE} = ( index( $ua, "googlebot" ) != -1 );
- $tests->{GOOGLEMOBILE} = ( index( $ua, "googlebot-mobile" ) != -1 );
- $tests->{MSN} = (
- ( index( $ua, "msnbot" ) != -1 || index( $ua, "bingbot" ) ) != -1 );
- $tests->{MSNMOBILE} = (
- ( index( $ua, "msnbot-mobile" ) != -1
- || index( $ua, "bingbot-mobile" )
- ) != -1
- );
$tests->{JAVA}
= ( index( $ua, "java" ) != -1
|| index( $ua, "jdk" ) != -1
|| index( $ua, "jakarta commons-httpclient" ) != -1 );
- $tests->{ALTAVISTA} = ( index( $ua, "altavista" ) != -1 );
- $tests->{SCOOTER} = ( index( $ua, "scooter" ) != -1 );
- $tests->{LYCOS} = ( index( $ua, "lycos" ) != -1 );
- $tests->{INFOSEEK} = ( index( $ua, "infoseek" ) != -1 );
- $tests->{WEBCRAWLER} = ( index( $ua, "webcrawler" ) != -1 );
- $tests->{LINKEXCHANGE} = ( index( $ua, "lecodechecker" ) != -1 );
- $tests->{SLURP} = ( index( $ua, "slurp" ) != -1 );
- $tests->{FACEBOOK} = ( index( $ua, "facebookexternalhit" ) != -1 );
- $tests->{BAIDU} = ( index( $ua, "baiduspider" ) != -1 );
- $tests->{GOOGLEADSBOT} = ( index( $ua, "adsbot-google" ) != -1 );
- $tests->{GOOGLEADSENSE} = ( index( $ua, "mediapartners-google" ) != -1 );
- $tests->{ASKJEEVES} = ( index( $ua, "ask jeeves/teoma" ) != -1 );
- $tests->{ROBOT} = (
- ( $tests->{WGET}
- || $tests->{PUF}
- || $tests->{GETRIGHT}
- || $tests->{LWP}
- || $tests->{YAHOO}
- || $tests->{ALTAVISTA}
- || $tests->{LYCOS}
- || $tests->{INFOSEEK}
- || $tests->{WEBCRAWLER}
- || $tests->{LINKEXCHANGE}
- || $tests->{SLURP}
- || $tests->{GOOGLE}
- || $tests->{GOOGLEMOBILE}
- || $tests->{MSN}
- || $tests->{MSNMOBILE}
- || $tests->{FACEBOOK}
- || $tests->{JAVA}
- || $tests->{BAIDU}
- || $tests->{GOOGLEADSBOT}
- || $tests->{GOOGLEADSENSE}
- || $tests->{ASKJEEVES}
- )
- || index( $ua, "bot" ) != -1
- || index( $ua, "spider" ) != -1
- || index( $ua, "crawl" ) != -1
- || index( $ua, "agent" ) != -1
- || $ua =~ /seek (?! mo (?: toolbar )? \s+ \d+\.\d+ )/x
- || $ua =~ /search (?! [\w\s]* toolbar \b | bar \b )/x
- || index( $ua, "reap" ) != -1
- || index( $ua, "worm" ) != -1
- || index( $ua, "find" ) != -1
- || index( $ua, "index" ) != -1
- || index( $ua, "copy" ) != -1
- || index( $ua, "fetch" ) != -1
- || index( $ua, "ia_archive" ) != -1
- || index( $ua, "zyborg" ) != -1
- );
+
$tests->{NETFRONT}
= ( index( $ua, "playstation 3" ) != -1
|| index( $ua, "playstation portable" ) != -1
@@ -532,21 +514,22 @@ sub _test {
# Devices
- $tests->{BLACKBERRY} = ( index( $ua, "blackberry" ) != -1 || index( $ua, "rim tablet os" ) != -1 );
- $tests->{IPHONE} = ( index( $ua, "iphone" ) != -1 );
- $tests->{WINCE} = ( index( $ua, "windows ce" ) != -1 );
- $tests->{WINPHONE} = ( index( $ua, "windows phone" ) != -1 );
- $tests->{WEBOS} = ( index( $ua, "webos" ) != -1 );
- $tests->{IPOD} = ( index( $ua, "ipod" ) != -1 );
- $tests->{IPAD} = ( index( $ua, "ipad" ) != -1 );
- $tests->{KINDLE} = ( index( $ua, "kindle" ) != -1 );
- $tests->{AUDREY} = ( index( $ua, "audrey" ) != -1 );
- $tests->{IOPENER} = ( index( $ua, "i-opener" ) != -1 );
- $tests->{AVANTGO} = ( index( $ua, "avantgo" ) != -1 );
- $tests->{PALM} = ( $tests->{AVANTGO} || index( $ua, "palmos" ) != -1 );
- $tests->{OBIGO} = ( index( $ua, "obigo/" ) != -1 );
- $tests->{WAP} = (
- $tests->{OBIGO}
+ $tests->{BLACKBERRY} = ( index( $ua, "blackberry" ) != -1
+ || index( $ua, "rim tablet os" ) != -1 );
+ $tests->{IPHONE} = ( index( $ua, "iphone" ) != -1 );
+ $tests->{WINCE} = ( index( $ua, "windows ce" ) != -1 );
+ $tests->{WINPHONE} = ( index( $ua, "windows phone" ) != -1 );
+ $tests->{WEBOS} = ( index( $ua, "webos" ) != -1 );
+ $tests->{IPOD} = ( index( $ua, "ipod" ) != -1 );
+ $tests->{IPAD} = ( index( $ua, "ipad" ) != -1 );
+ $tests->{KINDLE} = ( index( $ua, "kindle" ) != -1 );
+ $tests->{AUDREY} = ( index( $ua, "audrey" ) != -1 );
+ $tests->{IOPENER} = ( index( $ua, "i-opener" ) != -1 );
+ $tests->{AVANTGO} = ( index( $ua, "avantgo" ) != -1 );
+ $tests->{PALM} = ( $tests->{AVANTGO} || index( $ua, "palmos" ) != -1 );
+ $tests->{OBIGO} = ( index( $ua, "obigo/" ) != -1 );
+ $tests->{WAP}
+ = ( $tests->{OBIGO}
|| index( $ua, "up.browser" ) != -1
|| ( index( $ua, "nokia" ) != -1 && !$tests->{WINPHONE} )
|| index( $ua, "alcatel" ) != -1
@@ -566,10 +549,11 @@ sub _test {
$tests->{DSI} = ( index( $ua, "nintendo dsi" ) != -1 );
$tests->{'N3DS'} = ( index( $ua, "nintendo 3ds" ) != -1 );
-
$tests->{MOBILE} = (
- ( $tests->{FIREFOX} && index( $ua, "mobile" ) != -1 )
- || ( $tests->{IE} && !$tests->{WINPHONE} && index( $ua, "arm" ) != -1 )
+ ( $tests->{FIREFOX} && index( $ua, "mobile" ) != -1 )
+ || ( $tests->{IE}
+ && !$tests->{WINPHONE}
+ && index( $ua, "arm" ) != -1 )
|| index( $ua, "up.browser" ) != -1
|| index( $ua, "nokia" ) != -1
|| index( $ua, "alcatel" ) != -1
@@ -592,8 +576,10 @@ sub _test {
|| index( $ua, "iphone" ) != -1
|| index( $ua, "ipod" ) != -1
|| index( $ua, "ipad" ) != -1
- || (index( $ua, "opera mini" ) != -1 && index( $ua, "tablet" ) == -1 )
- || (index( $ua, "android" ) != -1 && index( $ua, "mobile" ) != -1 )
+ || ( index( $ua, "opera mini" ) != -1
+ && index( $ua, "tablet" ) == -1 )
+ || ( index( $ua, "android" ) != -1
+ && index( $ua, "mobile" ) != -1 )
|| index( $ua, "htc_" ) != -1
|| index( $ua, "symbian" ) != -1
|| index( $ua, "webos" ) != -1
@@ -612,12 +598,15 @@ sub _test {
|| $tests->{GOOGLEMOBILE}
|| $tests->{MSNMOBILE}
);
-
-
+
$tests->{TABLET} = (
- index( $ua, "ipad" ) != -1
- || ( $tests->{IE} && !$tests->{WINPHONE} && index( $ua, "arm" ) != -1 )
- || (index( $ua, "android" ) != -1 && index( $ua, "mobile" ) == -1 && index( $ua, "opera" ) == -1 )
+ index( $ua, "ipad" ) != -1
+ || ( $tests->{IE}
+ && !$tests->{WINPHONE}
+ && index( $ua, "arm" ) != -1 )
+ || ( index( $ua, "android" ) != -1
+ && index( $ua, "mobile" ) == -1
+ && index( $ua, "opera" ) == -1 )
|| index( $ua, "kindle" ) != -1
|| index( $ua, "xoom" ) != -1
|| index( $ua, "flyer" ) != -1
@@ -638,13 +627,189 @@ sub _test {
|| index( $ua, "an10bg3dt" ) != -1
|| index( $ua, "opera tablet" ) != -1
|| index( $ua, "rim tablet" ) != -1
- || index( $ua, "hp-tablet" ) != -1
-
-
+ || index( $ua, "hp-tablet" )
+ != -1
+
);
# Operating System
+ # A final try at browser version, if we haven't gotten it so far
+ if ( !defined( $major ) || $major eq '' ) {
+ if ( $ua =~ /[A-Za-z]+\/(\d+)\;/ ) {
+ $major = $1;
+ $minor = 0;
+ }
+
+ }
+
+ # Gecko version
+ $self->{gecko_version} = undef;
+ if ( $tests->{GECKO} ) {
+ if ( $ua =~ /\([^)]*rv:([\w.\d]*)/ ) {
+ $self->{gecko_version} = $1;
+ }
+ }
+
+ # Engines
+
+ $tests->{TRIDENT} = ( index( $ua, "trident/" ) != -1 );
+
+ $self->{engine_version} = $self->{gecko_version};
+
+ if ( $ua =~ /trident\/([\w\.\d]*)/ ) {
+ $self->{engine_version} = $1;
+ }
+
+ # RealPlayer
+ $tests->{REALPLAYER}
+ = ( index( $ua, "(r1 " ) != -1 || index( $ua, "realplayer" ) != -1 );
+
+ $self->{realplayer_version} = undef;
+ if ( $tests->{REALPLAYER} ) {
+ if ( $ua =~ /realplayer\/([\d+\.]+)/ ) {
+ $self->{realplayer_version} = $1;
+ my @version = split( /\./, $self->{realplayer_version} );
+ $major = shift @version;
+ $minor = shift @version;
+ }
+ elsif ( $ua =~ /realplayer\s(\w+)/ ) {
+ $self->{realplayer_version} = $1;
+ }
+ }
+
+ # Device from UA
+
+ $self->{device_name} = undef;
+
+ if ( $tests->{OBIGO} && $ua =~ /^(mot-\S+)/ ) {
+ $self->{device_name} = substr $self->{user_agent}, 0, length $1;
+ $self->{device_name} =~ s/^MOT-/Motorola /i;
+ }
+ elsif (
+ $ua =~ /windows phone os [^\)]+ iemobile\/[^;]+; ([^;]+; [^;\)]+)/g )
+ {
+ $self->{device_name} = substr $self->{user_agent},
+ pos( $ua ) - length $1, length $1;
+ $self->{device_name} =~ s/; / /;
+ }
+ elsif ( $ua
+ =~ /windows phone [^\)]+ iemobile\/[^;]+; arm; touch; ([^;]+; [^;\)]+)/g
+ )
+ {
+ $self->{device_name} = substr $self->{user_agent},
+ pos( $ua ) - length $1, length $1;
+ $self->{device_name} =~ s/; / /;
+ }
+
+ $self->{major} = $major;
+ $self->{minor} = $minor;
+ $self->{beta} = $beta;
+
+ $self->_os_tests;
+ $self->_robot_tests;
+
+ return unless $self->robot;
+
+}
+
+sub _robot_tests {
+ my $self = shift;
+ my $ua = lc $self->{user_agent};
+ my $tests = $self->{tests};
+
+ $tests->{LWP}
+ = ( index( $ua, "libwww-perl" ) != -1 || index( $ua, "lwp-" ) != -1 );
+ $tests->{YAHOO} = ( index( $ua, "yahoo" ) != -1 )
+ && ( index( $ua, 'jp.co.yahoo.android' ) == -1 );
+ $tests->{MSN} = (
+ ( index( $ua, "msnbot" ) != -1 || index( $ua, "bingbot" ) ) != -1 );
+ $tests->{MSNMOBILE} = (
+ ( index( $ua, "msnbot-mobile" ) != -1
+ || index( $ua, "bingbot-mobile" )
+ ) != -1
+ );
+
+ $tests->{ALTAVISTA} = ( index( $ua, "altavista" ) != -1 );
+ $tests->{ASKJEEVES} = ( index( $ua, "ask jeeves/teoma" ) != -1 );
+ $tests->{BAIDU} = ( index( $ua, "baiduspider" ) != -1 );
+ $tests->{CURL} = ( index( $ua, "libcurl" ) != -1 );
+ $tests->{FACEBOOK} = ( index( $ua, "facebookexternalhit" ) != -1 );
+ $tests->{GETRIGHT} = ( index( $ua, "getright" ) != -1 );
+ $tests->{GOOGLEADSBOT} = ( index( $ua, "adsbot-google" ) != -1 );
+ $tests->{GOOGLEADSENSE} = ( index( $ua, "mediapartners-google" ) != -1 );
+ $tests->{GOOGLEBOTIMAGE} = ( index( $ua, "googlebot-image" ) != -1 );
+ $tests->{GOOGLEBOTNEWS} = ( index( $ua, "googlebot-news" ) != -1 );
+ $tests->{GOOGLEBOTVIDEO} = ( index( $ua, "googlebot-video" ) != -1 );
+ $tests->{GOOGLEMOBILE} = ( index( $ua, "googlebot-mobile" ) != -1 );
+ $tests->{GOOGLE} = ( index( $ua, "googlebot" ) != -1 );
+ $tests->{INFOSEEK} = ( index( $ua, "infoseek" ) != -1 );
+ $tests->{LINKEXCHANGE} = ( index( $ua, "lecodechecker" ) != -1 );
+ $tests->{LINKCHECKER} = ( index( $ua, "linkchecker" ) != -1 );
+ $tests->{LYCOS} = ( index( $ua, "lycos" ) != -1 );
+ $tests->{PUF} = ( index( $ua, "puf/" ) != -1 );
+ $tests->{SCOOTER} = ( index( $ua, "scooter" ) != -1 );
+ $tests->{SLURP} = ( index( $ua, "slurp" ) != -1 );
+ $tests->{SPECIALARCHIVER} = ( index( $ua, "special_archiver" ) != -1 );
+ $tests->{WEBCRAWLER} = ( index( $ua, "webcrawler" ) != -1 );
+ $tests->{WGET} = ( index( $ua, "wget" ) != -1 );
+ $tests->{YANDEXIMAGES} = ( index( $ua, "yandeximages" ) != -1 );
+
+ $tests->{ROBOT}
+ = ( $tests->{ALTAVISTA}
+ || $tests->{ASKJEEVES}
+ || $tests->{BAIDU}
+ || $tests->{FACEBOOK}
+ || $tests->{GETRIGHT}
+ || $tests->{GOOGLEADSBOT}
+ || $tests->{GOOGLEADSENSE}
+ || $tests->{GOOGLEMOBILE}
+ || $tests->{GOOGLEBOTNEWS}
+ || $tests->{GOOGLEBOTIMAGE}
+ || $tests->{GOOGLEBOTVIDEO}
+ || $tests->{GOOGLE}
+ || $tests->{INFOSEEK}
+ || $tests->{JAVA}
+ || $tests->{LINKEXCHANGE}
+ || $tests->{LINKCHECKER}
+ || $tests->{LWP}
+ || $tests->{LYCOS}
+ || $tests->{MSNMOBILE}
+ || $tests->{MSN}
+ || $tests->{PUF}
+ || $tests->{SLURP}
+ || $tests->{SPECIALARCHIVER}
+ || $tests->{WEBCRAWLER}
+ || $tests->{WGET}
+ || $tests->{YAHOO}
+ || $tests->{YANDEXIMAGES} )
+ || index( $ua, "agent" ) != -1
+ || index( $ua, "bot" ) != -1
+ || index( $ua, "copy" ) != -1
+ || index( $ua, "crawl" ) != -1
+ || index( $ua, "fetch" ) != -1
+ || index( $ua, "find" ) != -1
+ || index( $ua, "ia_archive" ) != -1
+ || index( $ua, "index" ) != -1
+ || index( $ua, "reap" ) != -1
+ || index( $ua, "spider" ) != -1
+ || index( $ua, "worm" ) != -1
+ || index( $ua, "zyborg" ) != -1
+ || $ua =~ /seek (?! mo (?: toolbar )? \s+ \d+\.\d+ )/x
+ || $ua =~ /search (?! [\w\s]* toolbar \b | bar \b )/x;
+
+ # Yahoo Slurp! hack this should apply to most browsers, but there's a case
+ # where GoogleBot masquerades as Safari on iOS. not sure how to handle
+ # that.
+
+ delete $tests->{FIREFOX} if $self->robot;
+}
+
+sub _os_tests {
+ my $self = shift;
+ my $tests = $self->{tests};
+ my $ua = lc $self->{user_agent};
+
$tests->{WIN16}
= ( index( $ua, "win16" ) != -1
|| index( $ua, "16bit" ) != -1
@@ -755,8 +920,8 @@ sub _test {
$tests->{AIX3} = ( index( $ua, "aix 3" ) != -1 );
$tests->{AIX4} = ( index( $ua, "aix 4" ) != -1 );
- $tests->{LINUX} = ( index( $ua, "inux" ) != -1 );
- $tests->{SCO} = $ua =~ m{(?:SCO|unix_sv)};
+ $tests->{LINUX} = ( index( $ua, "inux" ) != -1 );
+ $tests->{SCO} = $ua =~ m{(?:SCO|unix_sv)};
$tests->{UNIXWARE} = ( index( $ua, "unix_system_v" ) != -1 );
$tests->{MPRAS} = ( index( $ua, "ncr" ) != -1 );
$tests->{RELIANT} = ( index( $ua, "reliantunix" ) != -1 );
@@ -801,137 +966,105 @@ sub _test {
$tests->{PS3GAMEOS} = $tests->{PS3} && $tests->{NETFRONT};
$tests->{PSPGAMEOS} = $tests->{PSP} && $tests->{NETFRONT};
+}
- # A final try at browser version, if we haven't gotten it so far
- if ( !defined( $major ) || $major eq '' ) {
- if ( $ua =~ /[A-Za-z]+\/(\d+)\;/ ) {
- $major = $1;
- $minor = 0;
- }
-
- }
-
- # Gecko version
- $self->{gecko_version} = undef;
- if ( $tests->{GECKO} ) {
- if ( $ua =~ /\([^)]*rv:([\w.\d]*)/ ) {
- $self->{gecko_version} = $1;
- }
- }
-
- # Engines
-
- $tests->{TRIDENT} = ( index( $ua, "trident/" ) != -1 );
+# undocumented, experimental, volatile. not bothering with major/minor here as
+# that's flawed for 3 point versions the plan is to move this parsing into the
+# UeberAgent parser
- $self->{engine_version} = $self->{gecko_version};
+sub os_version {
+ my $self = shift;
- if ( $ua =~ /trident\/([\w\.\d]*)/ ) {
- $self->{engine_version} = $1;
+ if ( $self->ios && $self->{user_agent} =~ m{OS (\d*_\d*|\d*_\d*_\d*) like Mac} ) {
+ my $version = $1;
+ $version =~ s{_}{.}g;
+ return $version;
}
- # RealPlayer
- $tests->{REALPLAYER}
- = ( index( $ua, "(r1 " ) != -1 || index( $ua, "realplayer" ) != -1 );
-
- $self->{realplayer_version} = undef;
- if ( $tests->{REALPLAYER} ) {
- if ( $ua =~ /realplayer\/([\d+\.]+)/ ) {
- $self->{realplayer_version} = $1;
- my @version = split( /\./, $self->{realplayer_version} );
- $major = shift @version;
- $minor = shift @version;
- }
- elsif ( $ua =~ /realplayer\s(\w+)/ ) {
- $self->{realplayer_version} = $1;
- }
+ if ( $self->mac && $self->{user_agent} =~ m{ X \s (\d\d)_(\d)_(\d)}x ) {
+ return join '.', $1, $2, $3;
}
- # Device from UA
-
- $self->{device_name} = undef;
-
- if ( $tests->{OBIGO} && $ua =~ /^(mot-\S+)/ )
- {
- $self->{device_name} = substr $self->{user_agent}, 0, length $1;
- $self->{device_name} =~ s/^MOT-/Motorola /i;
- }
- elsif ( $ua =~ /windows phone os [^\)]+ iemobile\/[^;]+; ([^;]+; [^;\)]+)/g )
+ if ( $self->winphone
+ && $self->{user_agent} =~ m{Windows \s Phone \s \w{0,2} \s{0,1} (\d+\.\d+);}x )
{
- $self->{device_name} = substr $self->{user_agent},
- pos( $ua ) - length $1, length $1;
- $self->{device_name} =~ s/; / /;
+ return $1;
}
- elsif ( $ua =~ /windows phone [^\)]+ iemobile\/[^;]+; arm; touch; ([^;]+; [^;\)]+)/g )
- {
- $self->{device_name} = substr $self->{user_agent},
- pos( $ua ) - length $1, length $1;
- $self->{device_name} =~ s/; / /;
+
+ if ( $self->android && $self->{user_agent} =~ m{Android ([\d\.\w-]*)} ) {
+ return $1;
}
- $self->{major} = $major;
- $self->{minor} = $minor;
- $self->{beta} = $beta;
+ if ( $self->firefoxos && $self->{user_agent} =~ m{Firefox/([\d\.]*)} ) {
+ return $1;
+ }
}
+# because the internals are the way they are, these tests have to happen in a
+# certain order. hopefully we can change this once we have lazily loaded
+# attributes. in the meantime, a pile of returns will do the job. if we
+# changed this to use a hash, we'd still need a carefully ordered array of keys
+# in order to get something useful back. so, as it is, this actually wouldn't
+# be that much less verbose and the order of operations is quite clear. it
+# still feels dirty, though. it does highlight the fact that way too many
+# methods can return true for some UA strings, which means there are probably a
+# lot of false positives we haven't checked for.
+
sub browser_string {
- my ( $self ) = _self_or_default( @_ );
- my $browser_string = undef;
- my $user_agent = $self->user_agent;
- if ( defined $user_agent ) {
- $browser_string = 'Netscape' if $self->netscape;
- $browser_string = 'Firefox' if $self->firefox;
- $browser_string = 'Safari' if $self->safari;
- $browser_string = 'Chrome' if $self->chrome;
- $browser_string = 'MSIE' if $self->ie;
- $browser_string = 'WebTV' if $self->webtv;
- $browser_string = 'AOL Browser' if $self->aol;
- $browser_string = 'Obigo' if $self->obigo;
- $browser_string = 'Opera' if $self->opera;
- $browser_string = 'Mosaic' if $self->mosaic;
- $browser_string = 'Lynx' if $self->lynx;
- $browser_string = 'Links' if $self->links;
- $browser_string = 'RealPlayer' if $self->realplayer_browser;
- $browser_string = 'IceWeasel' if $self->iceweasel;
- $browser_string = 'curl' if $self->curl;
- $browser_string = 'puf' if $self->puf;
- $browser_string = 'NetFront' if $self->netfront;
- $browser_string = 'Mobile Safari' if $self->mobile_safari;
- $browser_string = 'ELinks' if $self->elinks;
- $browser_string = 'BlackBerry' if $self->blackberry;
- $browser_string = 'Nintendo 3DS' if $self->n3ds;
- $browser_string = 'Nintendo DSi' if $self->dsi;
- }
- return $browser_string;
+ my ( $self ) = _self_or_default( @_ );
+ return unless defined $self->{user_agent};
+
+ return 'Netscape' if $self->netscape;
+ return 'IceWeasel' if $self->iceweasel;
+ return 'Firefox' if $self->firefox;
+ return 'BlackBerry' if $self->blackberry;
+ return 'Mobile Safari' if $self->mobile_safari;
+ return 'RealPlayer' if $self->realplayer_browser;
+ return 'Safari' if $self->safari;
+ return 'Chrome' if $self->chrome;
+ return 'AOL Browser' if $self->aol;
+ return 'MSIE' if $self->ie;
+ return 'WebTV' if $self->webtv;
+ return 'Obigo' if $self->obigo;
+ return 'Nintendo DSi' if $self->dsi;
+ return 'Opera' if $self->opera;
+ return 'Mosaic' if $self->mosaic;
+ return 'Lynx' if $self->lynx;
+ return 'ELinks' if $self->elinks;
+ return 'Links' if $self->links;
+ return 'curl' if $self->curl;
+ return 'puf' if $self->puf;
+ return 'NetFront' if $self->netfront;
+ return 'Nintendo 3DS' if $self->n3ds;
+ return;
}
sub os_string {
- my ( $self ) = _self_or_default( @_ );
- my $os_string = undef;
- my $user_agent = $self->user_agent;
- if ( defined $user_agent ) {
- $os_string = 'Win95' if $self->win95;
- $os_string = 'Win98' if $self->win98;
- $os_string = 'WinNT' if $self->winnt;
- $os_string = 'Win2k' if $self->win2k;
- $os_string = 'WinXP' if $self->winxp;
- $os_string = 'Win2k3' if $self->win2k3;
- $os_string = 'WinVista' if $self->winvista;
- $os_string = 'Win7' if $self->win7;
- $os_string = 'Win8' if $self->win8;
- $os_string = 'Windows Phone' if $self->winphone;
- $os_string = 'Mac' if $self->mac;
- $os_string = 'Mac OS X' if $self->macosx;
- $os_string = 'Win3x' if $self->win3x;
- $os_string = 'OS2' if $self->os2;
- $os_string = 'Unix' if $self->unix && !$self->linux;
- $os_string = 'Linux' if $self->linux;
- $os_string = 'Firefox OS' if $self->firefoxos;
- $os_string = 'RIM Tablet OS' if $self->rimtabletos;
- $os_string = 'Playstation 3 GameOS' if $self->ps3gameos;
- $os_string = 'Playstation Portable GameOS' if $self->pspgameos;
- $os_string = 'iOS' if $self->iphone || $self->ipod || $self->ipad;
- }
- return $os_string;
+ my ( $self ) = _self_or_default( @_ );
+ return unless defined $self->{user_agent};
+
+ return 'Win95' if $self->win95;
+ return 'Win98' if $self->win98;
+ return 'Win2k' if $self->win2k;
+ return 'WinXP' if $self->winxp;
+ return 'Win2k3' if $self->win2k3;
+ return 'WinVista' if $self->winvista;
+ return 'Win7' if $self->win7;
+ return 'Win8' if $self->win8;
+ return 'WinNT' if $self->winnt;
+ return 'Windows Phone' if $self->winphone;
+ return 'Mac OS X' if $self->macosx;
+ return 'Win3x' if $self->win3x;
+ return 'OS2' if $self->os2;
+ return 'Unix' if $self->unix && !$self->linux;
+ return 'Linux' if $self->linux;
+ return 'Firefox OS' if $self->firefoxos;
+ return 'RIM Tablet OS' if $self->rimtabletos;
+ return 'Playstation 3 GameOS' if $self->ps3gameos;
+ return 'Playstation Portable GameOS' if $self->pspgameos;
+ return 'iOS' if $self->iphone || $self->ipod || $self->ipad;
+ return 'Mac' if $self->mac;
+ return;
}
sub realplayer {
@@ -944,7 +1077,9 @@ sub realplayer {
sub _realplayer_version {
my ( $self, $check ) = _self_or_default( @_ );
- if ( exists $self->{realplayer_version} && $self->{realplayer_version} ) {
+ if ( exists $self->{realplayer_version}
+ && $self->{realplayer_version} )
+ {
my @version = split( /\./, $self->{realplayer_version} );
$self->{major} = shift @version;
$self->{minor} = $self->_format_minor( shift @version );
@@ -1042,7 +1177,7 @@ sub _public {
# Return Public version of Safari. See RT #48727.
if ( $self->safari ) {
- my $ua = lc $self->user_agent;
+ my $ua = lc $self->{user_agent};
# Safari starting with version 3.0 provides its own public version
if ($ua =~ m{
@@ -1067,12 +1202,12 @@ sub _public {
# lower build
for my $maybe_build (
- sort { $self->_cmp_versions($b, $a) }
+ sort { $self->_cmp_versions( $b, $a ) }
keys %safari_build_to_version
)
{
$version = $safari_build_to_version{$maybe_build}, last
- if $self->_cmp_versions($build, $maybe_build) >= 0;
+ if $self->_cmp_versions( $build, $maybe_build ) >= 0;
}
}
my ( $major, $minor ) = split /\./, $version;
@@ -1094,7 +1229,7 @@ sub _cmp_versions {
while ( @b ) {
return -1 if @a == 0 || $a[0] < $b[0];
- return 1 if @b == 0 || $b[0] < $a[0];
+ return 1 if @b == 0 || $b[0] < $a[0];
shift @a;
shift @b;
}
@@ -1106,7 +1241,7 @@ sub engine_string {
my ( $self, $check ) = _self_or_default( @_ );
- if ( $self->user_agent =~ m{\bKHTML\b} ) {
+ if ( $self->{user_agent} =~ m{\bKHTML\b} ) {
return 'KHTML';
}
@@ -1232,28 +1367,30 @@ sub _language_country {
if ( $self->safari ) {
if ( $self->major == 1
- && $self->user_agent =~ m/\s ( [a-z]{2} ) \)/xms )
+ && $self->{user_agent} =~ m/\s ( [a-z]{2} ) \)/xms )
{
return { language => uc $1 };
}
- if ( $self->user_agent =~ m/\s ([a-z]{2})-([A-Za-z]{2})/xms ) {
+ if ( $self->{user_agent} =~ m/\s ([a-z]{2})-([A-Za-z]{2})/xms ) {
return { language => uc $1, country => uc $2 };
}
}
- if ( $self->aol && $self->user_agent =~ m/;([A-Z]{2})_([A-Z]{2})\)/ ) {
+ if ( $self->aol
+ && $self->{user_agent} =~ m/;([A-Z]{2})_([A-Z]{2})\)/ )
+ {
return { language => $1, country => $2 };
}
- if ( $self->user_agent =~ m/\b([a-z]{2})-([A-Za-z]{2})\b/xms ) {
+ if ( $self->{user_agent} =~ m/\b([a-z]{2})-([A-Za-z]{2})\b/xms ) {
return { language => uc $1, country => uc $2 };
}
- if ( $self->user_agent =~ m/\[([a-z]{2})\]/xms ) {
+ if ( $self->{user_agent} =~ m/\[([a-z]{2})\]/xms ) {
return { language => uc $1 };
}
- if ( $self->user_agent =~ m/\(([^)]+)\)/xms ) {
+ if ( $self->{user_agent} =~ m/\(([^)]+)\)/xms ) {
my @parts = split( /;/, $1 );
foreach my $part ( @parts ) {
if ( $part =~ /^\s*([a-z]{2})\s*$/ ) {
@@ -1290,6 +1427,17 @@ sub browser_properties {
return @browser_properties;
}
+
+sub robot_name {
+ my $self = shift;
+ foreach my $name ( @ROBOT_TESTS ) {
+ next if $name eq 'robot';
+ if ( $self->$name ) {
+ return $ROBOTS{$name};
+ }
+ }
+}
+
1;
# ABSTRACT: Determine Web browser, version, and platform from an HTTP user agent string
@@ -1304,7 +1452,7 @@ HTTP::BrowserDetect - Determine Web browser, version, and platform from an HTTP
=head1 VERSION
-version 1.55
+version 1.59
=head1 SYNOPSIS
@@ -1331,9 +1479,6 @@ version 1.55
...;
}
- # Process a different user agent string
- $browser->user_agent($another_user_agent_string);
-
=head1 DESCRIPTION
The HTTP::BrowserDetect object does a number of tests on an HTTP user agent
@@ -1358,12 +1503,12 @@ HTTP::BrowserDetect object that is created behind the scenes.
=head1 SUBROUTINES/METHODS
-=head2 user_agent($user_agent_string)
+=head2 user_agent()
+
+Returns the value of the user agent string.
-Returns the value of the user agent string. When called with a parameter, it
-resets the user agent and reperforms all tests on the string. This way you can
-process a series of user agent strings (from a log file, perhaps) without
-creating a new HTTP::BrowserDetect object each time.
+Calling this method with a parameter has now been deprecated and this feature
+will be removed in an upcoming release.
=head2 country()
@@ -1619,7 +1764,7 @@ Returns undef on failure. Otherwise returns one of the following:
Netscape, Firefox, Safari, Chrome, MSIE, WebTV, AOL Browser, Opera, Mosaic,
Lynx, Links, ELinks, RealPlayer, IceWeasel, curl, puf, NetFront, Mobile Safari,
-BlackBerry
+BlackBerry.
=head2 gecko_version()
@@ -1816,15 +1961,9 @@ POD coverage is also not 100%.
=head1 SEE ALSO
-"The Ultimate JavaScript Client Sniffer, Version 3.0", L<http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html>
-
"Browser ID (User-Agent) Strings", L<http://www.zytrax.com/tech/web/browser_ids.htm>
-Safari "Historical User Agent strings", L<http://developer.apple.com/internet/safari/uamatrix.html> (now gone, retrieved 2007-06-20)
-
-"Safari Agent Strings", L<http://homepage.mac.com/jprince/designSandbox/web/safari-agents/>
-
-perl(1), L<HTTP::Headers>, L<HTTP::Headers::UserAgent>.
+L<HTML::ParseBrowser>.
=head1
diff --git a/t/01-detect.t b/t/01-detect.t
index 938315d..f3b0aac 100644
--- a/t/01-detect.t
+++ b/t/01-detect.t
@@ -19,8 +19,7 @@ my $w;
}
ok !$w;
-
-my $json = read_file( "$FindBin::Bin/useragents.json" );
+my $json = read_file( "$FindBin::Bin/useragents.json" );
my $tests = JSON::PP->new->ascii->decode( $json );
@@ -31,7 +30,7 @@ foreach my $ua ( sort keys %{$tests} ) {
my $detected = HTTP::BrowserDetect->new( $ua );
diag( $detected->user_agent );
- foreach my $method ( 'browser_string', 'engine_string', 'os_string' ) {
+ foreach my $method ( 'browser_string', 'engine_string', 'os_string', 'os_version' ) {
if ( $test->{$method} ) {
cmp_ok( $detected->$method, 'eq', $test->{$method},
"$method: $test->{$method}" );
@@ -64,7 +63,7 @@ foreach my $ua ( sort keys %{$tests} ) {
}
}
- foreach my $method ( 'language', 'device', 'device_name' ) {
+ foreach my $method ( 'language', 'device', 'device_name', 'robot_name' ) {
if ( exists $test->{$method}
and defined $test->{$method}
and length $test->{$method} )
@@ -99,14 +98,11 @@ foreach my $ua ( sort keys %{$tests} ) {
}
-
-my $detected = HTTP::BrowserDetect->new('Nonesuch');
+my $detected = HTTP::BrowserDetect->new( 'Nonesuch' );
diag( $detected->user_agent );
foreach my $method (
qw(
- browser_string
- os_string
engine_string
engine_version
engine_major
@@ -117,8 +113,8 @@ foreach my $method (
)
)
{
- is_deeply([$detected->$method], [undef],
- "$method should return undef in list context" );
+ is_deeply( [ $detected->$method ],
+ [undef], "$method should return undef in list context" );
}
done_testing();
diff --git a/t/03-language.t b/t/03-language.t
index d46ed0d..3c1361c 100644
--- a/t/03-language.t
+++ b/t/03-language.t
@@ -7,10 +7,10 @@ use Test::More;
use Test::NoWarnings ();
use HTTP::BrowserDetect;
+my $browser = HTTP::BrowserDetect->new(
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)" );
-my $browser = HTTP::BrowserDetect->new( "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)" );
-
-ok (!$browser->language, "no language detected");
+ok( !$browser->language, "no language detected" );
diag( $browser->language );
Test::NoWarnings::had_no_warnings();
done_testing();
diff --git a/t/useragents.json b/t/useragents.json
index 2d29a83..f7bb617 100644
--- a/t/useragents.json
+++ b/t/useragents.json
@@ -74,6 +74,7 @@
"public_major" : "2",
"public_minor" : ".1",
"public_version" : "2.1",
+ "robot_name" : "Google Mobile",
"version" : "2.1"
},
"ELinks/0.12~pre5-2ubuntu1 (textmode; Ubuntu; Linux 2.6.32-24-generic x86_64; 135x85-2)" : {
@@ -120,16 +121,20 @@
"Googlebot-News" : {
"match" : [
"google",
+ "googlebotnews",
"robot"
- ]
+ ],
+ "robot_name" : "Googlebot News"
},
"Googlebot-Image/1.0" : {
"major" : "1",
"minor" : "0",
"match" : [
"google",
+ "googlebotimage",
"robot"
],
+ "robot_name" : "Googlebot Images",
"version" : "1"
},
"Googlebot-Video/1.0" : {
@@ -137,8 +142,10 @@
"minor" : "0",
"match" : [
"google",
+ "googlebotvideo",
"robot"
],
+ "robot_name" : "Googlebot Video",
"version" : "1"
},
"Googlebot/1.0 (googlebot at googlebot.com http://googlebot.com/)" : {
@@ -1246,6 +1253,7 @@
"device"
],
"minor" : "0.25",
+ "os_version" : "1.5",
"public_major" : "3",
"public_minor" : "0.1",
"public_version" : "3.1",
@@ -1268,6 +1276,7 @@
"unix"
],
"minor" : "0.30",
+ "os_version" : "2.1-update1",
"public_major" : "4",
"public_minor" : "0",
"public_version" : "4.0",
@@ -1300,6 +1309,7 @@
"macosx"
],
"minor" : "0.6",
+ "os_string" : "Mac OS X",
"public_major" : "3",
"public_minor" : "0.6",
"public_version" : "3.6",
@@ -1555,6 +1565,7 @@
"mobile"
],
"os_string" : "Firefox OS",
+ "os_version" : "18.0",
"public_version" : "18.0",
"version" : "18.0"
},
@@ -2409,6 +2420,7 @@
"device"
],
"minor" : "0.31",
+ "os_version" : "3.2",
"public_major" : "4",
"public_minor" : "0",
"public_version" : "4.0",
@@ -2456,6 +2468,7 @@
"safari"
],
"os_string" : "iOS",
+ "os_version" : "4.1",
"public_major" : "4",
"public_minor" : "0",
"public_version" : "4.0"
@@ -2725,6 +2738,7 @@
"sco"
],
"os" : "Mac",
+ "os_version" : "10.6.2",
"other" : null,
"version" : "11.0"
},
@@ -3026,6 +3040,7 @@
],
"os" : "WinPhone",
"os_string" : "Windows Phone",
+ "os_version" : "7.0",
"device_name" : "HTC T7575"
},
"Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; T7575)" : {
@@ -3045,6 +3060,7 @@
],
"os" : "WinPhone",
"os_string" : "Windows Phone",
+ "os_versin" : "7.5",
"device_name" : "HTC T7575"
},
"Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 510)" : {
@@ -3065,6 +3081,7 @@
],
"os" : "WinPhone",
"os_string" : "Windows Phone",
+ "os_version" : "7.5",
"device_name" : "NOKIA Lumia 510"
},
"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; 8X)" : {
@@ -3085,6 +3102,7 @@
],
"os" : "WinPhone",
"os_string" : "Windows Phone",
+ "os_version" : "8.0",
"device_name" : "HTC 8X"
},
"Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.6; AOLBuild 4340.168; Windows NT 5.1; Trident/5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; IE0006_ver1;EN_US)" : {
@@ -3187,6 +3205,7 @@
"robot"
],
"os" : null,
+ "os_version" : "5.0",
"version" : "5.34"
},
"Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; ja-JP) AppleWebKit/534.12 (KHTML, like Gecko) Puffin/1.3.3507MS Mobile Safari/534.12" : {
@@ -3207,6 +3226,7 @@
"robot"
],
"os" : null,
+ "os_version" : "5.0",
"version" : "5.34"
},
"Mozilla/5.0 (X11; U; Linux i686; ja-JP) AppleWebKit/534.12 (KHTML, like Gecko) Puffin/1.3.3507MS Safari/534.12" : {
@@ -3274,7 +3294,7 @@
"public_version" : "1.7412"
},
"Mozilla/DnsHealthCheckBot/1.0" : {
- "browser_string" : "Netscape",
+ "browser_string" : "",
"match" : [
"netscape",
"robot"
@@ -3357,7 +3377,47 @@
"public_major" : "3",
"public_minor" : "0",
"version" : "5.25"
+ },
+ "Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp) NOT Firefox/3.5" : {
+ "robot_name" : "Yahoo! Slurp",
+ "match" : [
+ "robot",
+ "slurp",
+ "yahoo"
+ ]
+ },
+ "LinkChecker/7.4 (+http://linkchecker.sourceforge.net/)" : {
+ "robot_name" : "LinkChecker",
+ "match" : [
+ "robot",
+ "linkchecker"
+ ]
+ },
+ "Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)" : {
+ "robot_name" : "YandexImages",
+ "match" : [
+ "robot",
+ "yandeximages"
+ ]
+ },
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329" : {
+ "device" : "iphone",
+ "match" : [
+ "device",
+ "iphone",
+ "ios",
+ "mobile",
+ "safari"
+ ],
+ "os_string" : "iOS",
+ "os_version" : "6.1.3"
+ },
+ "Mozilla/5.0 (compatible; special_archiver/3.1.1 +http://www.archive.org/details/archive.org_bot)" : {
+ "robot_name" : "archive.org_bot",
+ "match" : [
+ "robot",
+ "specialarchiver"
+ ]
}
}
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libhttp-browserdetect-perl.git
More information about the Pkg-perl-cvs-commits
mailing list