# Copyright (c) 2008-2011 bivio Software Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: UserAgent.bunit,v 1.8 2011/11/17 17:22:59 moeller Exp $ Request(); options({ create_object => sub { my(undef, $params) = @_; return class()->unsafe_from_any($params->[0]) || class(); }, }); [ class() => [ from_header => [ map(($_ => 'BROWSER_ROBOT_SEARCH'), 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', 'Mozilla/5.0 (compatible; Yahoo! Slurp;http://help.yahoo.com/help/us/ysearch/slurp)', 'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)', 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)', 'Mozilla/5.0 (compatible; Ask Jeeves/Teoma; +http://about.ask.com/en/docs/about/webmasters.shtml)', 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)' ), map(($_ => 'BROWSER_ROBOT_OTHER'), 'Mozilla/5.0 (compatible; MJ12bot/v1.3.3; http://www.majestic12.co.uk/bot.php?+)', 'Mozilla/5.0 (compatible; discobot/1.1; +http://discoveryengine.com/discobot.html)', 'Mozilla/5.0 (compatible; Exabot/3.0; +http://www.exabot.com/go/robot)', 'Sosospider+(+http://help.soso.com/webspider.htm)', 'TLSProber/0.1', 'Yeti/1.0 (NHN Corp.; http://help.naver.com/robots/)', 'libwww-perl/5.79', 'lwp-request/2.06', 'psbot/0.1 (+http://www.picsearch.com/bot.html)', ), map(($_ => 'BROWSER_FIREFOX_1'), 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4', ), map(($_ => 'BROWSER_MSIE_6'), 'Mozilla/4.0 (compatible; MSIE 6.0; AOL 6.0; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en) Opera 8.01', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)', ), map(($_ => 'BROWSER_MSIE_7'), 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)', 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0; Media Center PC 3.1; Media Center PC $(runtime.Emerald_version))', ), map(($_ => 'BROWSER_MSIE_8'), 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', 'Mozilla/4.0 (compatible; MSIE 25.0; Windows 2098)', ), map(($_ => 'BROWSER_HTML3'), 'Mozilla/3.01 [frC-SYMPA (Win95; I)', 'Mozilla/4.0 (compatible; MSIE 4.01; AOL 5.0; Mac_PPC)', '', [undef], ), map(($_ => 'BROWSER_HTML4'), 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.17) Gecko/20080915 Camino/1.6.4 (like Firefox/2.0.0.17)', 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.3.154.9 Safari/525.19', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4', ), 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511' => 'BROWSER_MOZILLA_1', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)' => 'BROWSER_MSIE_5', 'b-sendmail-http' => 'MAIL', ], ], 'MAIL' => [ has_over_caching_bug => 0, has_table_layout_bug => 0, is_browser => 0, is_css_compatible => 0, is_actual_browser => 0, ], 'BROWSER_HTML3' => [ has_over_caching_bug => 0, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 0, ], 'BROWSER_HTML4' => [ has_over_caching_bug => 0, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 1, ], 'BROWSER_MSIE_5' => [ has_over_caching_bug => 1, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 1, ], 'BROWSER_MSIE_6' => [ has_over_caching_bug => 1, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 1, ], 'BROWSER_MSIE_7' => [ has_over_caching_bug => 1, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 1, ], 'BROWSER_MSIE_8' => [ has_over_caching_bug => 1, has_table_layout_bug => 0, is_browser => 1, is_css_compatible => 1, is_actual_browser => 1, ], 'BROWSER_FIREFOX_1' => [ has_over_caching_bug => 0, has_table_layout_bug => 1, is_browser => 1, is_css_compatible => 1, ], 'BROWSER_MOZILLA_1' => [ has_over_caching_bug => 0, has_table_layout_bug => 1, is_browser => 1, is_css_compatible => 1, is_actual_browser => 1, ], 'BROWSER_ROBOT_OTHER' => [ has_over_caching_bug => 0, has_table_layout_bug => 0, is_browser => 1, is_robot => 1, is_css_compatible => 1, is_actual_browser => 0, is_robot_search => 0, is_robot_search_verified => 0, ], 'BROWSER_ROBOT_SEARCH' => [ has_over_caching_bug => 0, has_table_layout_bug => 0, is_browser => 1, is_robot => 1, is_css_compatible => 1, is_actual_browser => 0, is_robot_search => 1, { method => 'is_robot_search_verified', compute_params => sub { my($case, $params) = @_; $case->get('object')->put_on_request(req()); return [req()->put( client_addr => $params->[0], is_production => 1, )]; }, } => [ '66.249.66.1' => 1, '127.0.0.1' => 0, '0.0.0.0' => 0, [undef] => 0, ], ], ];