sniff_browser.py

  • strict warning: Non-static method view::load() should not be called statically in /home/saturn/public_html/blog/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/saturn/public_html/blog/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/saturn/public_html/blog/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/saturn/public_html/blog/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/saturn/public_html/blog/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/saturn/public_html/blog/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/saturn/public_html/blog/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Copyright (c) 2010 Raoul Snyman

This file is licensed under the GNU GPL.

``sniff_browser.py`` is a file with a single goal: To figure out what the heck
your browser is, based on the user agent string. In order to test the browser
sniffing function, a list of real user agents has been extracted from the page
on browser id's, aka user agent strings, on the Zytrax site.
"""

import re

# List of user agents, courtesy of http://www.zytrax.com/tech/web/browser_ids.htm
USER_AGENTS = [
    u'Science Traveller International 1X/1.0',
    u'Mozilla/3.0 (compatible)',
    u'amaya/9.52 libwww/5.4.0',
    u'amaya/9.51 libwww/5.4.0',
    u'amaya/9.1 libwww/5.4.0',
    u'amaya/6.2 libwww/5.3.1',
    u'AmigaVoyager/3.4.4 (MorphOS/PPC native)',
    u'xChaos_Arachne/5.1.89;GPL,386+',
    u'Ubuntu APT-HTTP/1.3 (0.7.23.1ubuntu2)',
    u'Ubuntu APT-HTTP/1.3',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3)  Arora/0.3 (Change: 287 c9dfb30)',
    u'Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3)  Arora/0.2 (Change: 0 )',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; FDM)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Avant Browser [avantbrowser.com]; Hotbar 4.4.5.0)',
    u'Amiga-AWeb/3.5.07 beta',
    u'Mozilla/6.0; (Spoofed by Amiga-AWeb/3.5.07 beta)',
    u'MSIE/6.0; (Spoofed by Amiga-AWeb/3.4APL)',
    u'gnome-vfs/2.12.0 neon/0.24.7',
    u'bluefish 0.6 HTML editor',
    u'Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.14) Gecko/20080409 Camino/1.6 (like Firefox/2.0.0.14)',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.6) Gecko/20070809 Camino/1.5.1',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.1) Gecko/20060118 Camino/1.0b2+',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030917 Camino/0.7+',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.1) Gecko/20021104 Chimera/0.6',
    u'Mozilla/4.08 (Charon; Inferno)',
    u'Mozilla/2.0 compatible; Check&Get 1.14 (Windows NT)',
    u'Chimera/2.0alpha',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Chrome/5.0.322.2 Safari/533.1',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.9 Safari/532.9',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11 Safari/532.9',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.78 Safari/532.5',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Chrome/4.0.233.0 Safari/532.4',
    u'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.198.0 Safari/532.0',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; Valve Steam GameOverlay; ) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/3.0.195.24 Safari/532.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-US) AppleWebKit/531.0 (KHTML, like Gecko) Chrome/3.0.183 Safari/531.0',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19',
    u'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Comodo_Dragon/4.0.1.6 Chrome/4.0.249.78 Safari/532.5',
    u'Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/)',
    u'Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/)',
    u'curl/7.19.5 (i586-pc-mingw32msvc) libcurl/7.19.5 OpenSSL/0.9.8l zlib/1.2.3',
    u'curl/7.7.2 (powerpc-apple-darwin6.0) libcurl 7.7.2 (OpenSSL 0.9.6b)',
    u'Dillo/0.6.6',
    u'DocZilla/1.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020804',
    u'edbrowse/2.2.10',
    u'ELinks/0.12~pre2.dfsg0-1ubuntu1-lite (textmode; Debian; Linux 2.6.32-4-jolicloud i686; 143x37-2)',
    u'ELinks/0.12pre5.GIT (textmode; CYGWIN_NT-6.1 1.7.1(0.218/5/3) i686; 80x24-2)',
    u'ELinks/0.11.3-5ubuntu2-lite (textmode; Debian; Linux 2.6.24-19-generic i686; 126x37-2)',
    u'ELinks/0.11.4-2 (textmode; Debian; GNU/kFreeBSD 6.3-1-486 i686; 141x21-2)',
    u'ELinks (0.4.3; NetBSD 3.0.2_PATCH sparc64; 141x19)',
    u'ELinks/0.10.4-7ubuntu1-debian (textmode; Linux 2.6.12-10-k7-smp i686; 80x24-2)',
    u'ELinks/0.10.5 (textmode; CYGWIN_NT-5.0 1.5.18(0.132/4/2) i686; 143x51-2)',
    u'ELinks (0.4.2; Linux; )',
    u'Emacs-W3/4.0pre.46 URL/p4.0pre.46 (i686-pc-linux; X11)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.29.5',
    u'Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.11) Gecko/20080528 Epiphany/2.22 Firefox/3.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/420+ (KHTML, like Gecko)',
    u'Mozilla/5.0 (X11; U; Linux x86_64; c) AppleWebKit/525.1+ (KHTML, like Gecko, Safari/525.1+) epiphany',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.8.1.4) Gecko/20061201 Epiphany/2.18 Firefox/2.0.0.4 (Ubuntu-feisty)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060731 Epiphany/2.14 Firefox/1.5.0.5',
    u'Mozilla/5.0 (X11; U; Linux i686; en; rv:1.8.1) Gecko/20061203 Epiphany/2.16 Firefox/2.0',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.1) Gecko/Debian-1.8.0.1-5 Epiphany/1.8.5',
    u'Mozilla/5.0 (X11; U; Linux i686; cs-CZ; rv:1.7.13) Gecko/20060418 Epiphany/1.8.2 (Ubuntu) (Ubuntu package 1.0.8)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040924 Epiphany/1.4.4 (Ubuntu)',
    u'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030 Epiphany/1.0.8',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Epiphany/1.0.4',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030704 Epiphany/0.9.2',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 Epiphany/0.8.4',
    u'fetch libfetch/2.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 BAVM/1.0.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8',
    u'Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1',
    u'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20100925 Firefox/4.0b7pre',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100215 Solaris/10.1 (GNU) Superswan/3.5.8 (Byte/me)',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3',
    u'Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.14) Gecko/20080821 Firefox/2.0.0.14',
    u'Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US; rv:1.8.0.12) Gecko/20070803 Firefox/1.5.0.12 Fink Community Edition',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060410 Firefox/1.0.8',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20041002 Firefox/0.10.1',
    u'Mozilla/5.0 (X11; U; SunOS sun4m; en-US; rv:1.4b) Gecko/20030517 Mozilla Firebird/0.6',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 Phoenix/0.1',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008100716 Firefox/3.0.3 Flock/2.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060612 Firefox/1.5.0.4 Flock/0.7.0.17.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051019 Flock/0.4 Firefox/1.0+',
    u'Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.19) Gecko/20090701 Galeon/2.0.7',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080208 Galeon/2.0.4 (2008.1) Firefox/2.0.0.13',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20061201 Galeon/2.0.2 (Ubuntu package 2.0.2-4ubuntu1)',
    u'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20051105 Galeon/1.3.21',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 Galeon/1.3.18',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Galeon/1.3.17 (Debian package 1.3.17-2)',
    u'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 Galeon/1.3.12',
    u'Mozilla/5.0 (X11; U; Linux i686) Gecko/20030422 Galeon/1.3.4',
    u'Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020326',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072716 IceCat/3.0.1-g1',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071420 Iceweasel/3.0.1 (Debian-3.0.1-1)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071008 Iceape/1.1.5 (Ubuntu-1.1.5-1ubuntu0.7.10)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4)',
    u'Gecko/20060620 Iceweasel/1.5.0.4-g1',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;)',
    u'Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2',
    u'Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3',
    u'Mediapartners-Google/2.1',
    u'Google-Sitemaps/1.0',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser;',
    u'Deepnet Explorer 1.5.3; Smart 2x2; Avant Browser; .NET CLR 2.0.50727; InfoPath.1)',
    u'Mozilla/3.0 (x86 [en] Windows NT 5.1; Sun)',
    u'Mozilla/4.5 RPT-HTTPClient/0.3-2',
    u'Jakarta Commons-HttpClient/2.0.1',
    u'Mozilla/5.1 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060425 SUSE/1.5.0.3-7 Hv3/alpha',
    u'IBrowse/2.4 (AmigaOS 3.9; 68K)',
    u'IBrowse/2.3 (AmigaOS V51)',
    u'IBrowse/2.3 (AmigaOS 4.0)',
    u'iCab/2.9.7 (Macintosh; U; PPC)',
    u'iCab/2.9.5 (Macintosh; U; PPC; Mac OS X)',
    u'Mozilla/4.5 (compatible; iCab 2.7.1; Macintosh; I; PPC)',
    u'ipd/1.0 from AlertSite.com',
    u'ICE Browser/5.05 (Java 1.4.0; Windows 2000 5.0 x86)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko Kazehakase/0.5.4 Debian/0.5.4-2.1ubuntu3',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 (Debian-1.8.1.13+nobinonly-0ubuntu1) Kazehakase/0.5.2',
    u'Mozilla/5.0 (X11; Linux x86_64; U;) Gecko/20060207 Kazehakase/0.3.5 Debian/0.3.5-1',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; KKman2.0)',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.4) Gecko/20070511 K-Meleon/1.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 K-MeleonCCFME 0.09',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.7) Gecko/20060917 K-Meleon/1.02',
    u'Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.5) Gecko/20041220 K-Meleon/0.9',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2',
    u'Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8.2',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5) Gecko/20031016 K-Meleon/0.8',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021016 K-Meleon 0.7',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.5) Gecko/20011011',
    u'Mozilla/5.0(Windows;N;Win98;m18)Gecko/20010124',
    u'Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.19-32mdkenterprise; X11; i686; ar, en_US)',
    u'Links',
    u'Links (2.1pre31; Linux 2.6.21-omap1 armv6l; x)',
    u'Links (2.1pre18; Linux 2.6.17-dyne i686; x)',
    u'Links (2.1pre15; Linux 2.4.26-vc4 i586; x)',
    u'Links (2.1pre14; OS/2 1 i386; 80x33)',
    u'Links (0.99; OS/2 1 i386; 80x33)',
    u'Links (0.98; Linux 2.6.7-rc2 i686; 132x43)',
    u'Links (0.98; Unix; 80x25)',
    u'Links (0.95; Unix)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; U; Windows;) Lobo/0.98.2',
    u'Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6b',
    u'Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6b',
    u'Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/1.0.16',
    u'Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/0.8.12',
    u'Lynx/2.8.3rel.1 libwww-FM/2.14FM',
    u'Lynx/2.8.4dev.11 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6',
    u'Lynx/2.6  libwww-FM/2.14',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)',
    u'Midori/0.2.2 (X11; Linux i686; U; en-us) WebKit/531.2+',
    u'Mozilla/5.0 (X11; U; Linux armv6l; en-us) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) midori',
    u'Mozilla/5.0 (X11; U; Linux i686; fr-fr) AppleWebKit/525.1+ (KHTML, like Gecko, Safari/525.1+) midori',
    u'PATHWORKS Mosaic/1.0  libwww/2.15_Spyglass',
    u'WinMosaic/Version 2.0 (ALPHA 2)',
    u'VMS_Mosaic/3.8-1 (Motif;OpenVMS V7.3-2 DEC 3000 - M700)  libwww/2.12_Mosaic',
    u'Mosaic from Digital/1.02_Win32',
    u'NCSA Mosaic/2.0.0b4 (Windows AXP)',
    u'NCSA_Mosaic/2.7b5 (X11;Linux 2.6.7 i686) libwww/2.12 modified',
    u'mMosaic/3.6.6 (X11;SunOS 5.8 sun4m)',
    u'mothra/Jul-10-17:33:30-EDT-2006',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100508 SeaMonkey/2.0.4',
    u'Mozilla/5.0 (X11; U; Linux i686; nb-NO; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b1pre) Gecko/20080915000512 SeaMonkey/2.0a1pre',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9pre) Gecko/2008060901 SeaMonkey/2.0a1pre',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 (Ubuntu-1.1.9+nobinonly-0ubuntu1)',
    u'Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.8',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.8) Gecko/20071009 SeaMonkey/1.1.5',
    u'Mozilla/5.0 (Windows; U; WinNT3.51; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4',
    u'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.8pre) Gecko/20070926 SeaMonkey/1.1.5pre',
    u'Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US;  rv:1.8.1.5) Gecko/20070803 SeaMonkey/1.1.3',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060823 SeaMonkey/1.1a',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040616 MultiZilla/1.6.3.1d',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.2) Gecko/20020924 AOL/7.0',
    u'Mozilla/5.0 (Windows; U; Win 9x 4.90) Gecko/20020502 CS 2000 7.0/7.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b; MultiZilla v1.5.0.2g) Gecko/20030827',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030504 Mozilla Firebird/0.5+StumbleUpon/1.63',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2) Gecko/20021126',
    u'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2) Gecko/20021126',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2a) Gecko/20020910',
    u'Mozilla/5.0 (X11; U; Linux 2.4.3-20mdk i586; en-US; rv:0.9.1) Gecko/20010611',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)',
    u'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
    u'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; Creative AutoUpdate v1.40.02)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; Creative AutoUpdate v1.40.02)',
    u'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)',
    u'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB0.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; GACID=)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; FunWebProducts; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; Windows-Media-Player/10.00.00.3990)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.4; .NET CLR 1.1.4322; FDM; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Rogers Hi┬ĚSpeed Internet; (R1 1.3))',
    u'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
    u'Mozilla/4.0 (compatible; MSIE 5.0; SunOS 5.10 sun4u; X11)',
    u'Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)',
    u'Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0)',
    u'Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)',
    u'Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; MyIE2; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; TheWorld)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6.3; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; ws8 Embedded Web Browser from: http://bsalsa.com/; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)',
    u'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.0; Smart Bro)',
    u'MMozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Tablet PC 2.0) Sleipnir/2.8.3',
    u'muCommander v0.8.3 (Java 1.6.0_0-b11; Linux 2.6.24-19-generic i386)',
    u'muCommander v0.8.3 (Java 1.4.2_03-b02; Windows XP 5.1 x86)',
    u'Mozilla/3.0 (compatible; NetPositive/2.2.2; BeOS)',
    u'Mozilla/3.0 (compatible; NetPositive/2.2.1; BeOS)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080219 Firefox/2.0.0.12 Navigator/9.0.0.6',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8pre) Gecko/20071019 Firefox/2.0.0.8 Navigator/9.0.0.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3',
    u'Mozilla/4.8 [en] (X11; U; Linux 2.4.20-8 i686)',
    u'Mozilla/3.04Gold (X11; U; IRIX 5.3 IP22)',
    u'Mozilla/3.01 (WinNT; I) [AXP]',
    u'Mozilla/2.02 [fr] (WinNT; I)',
    u'Mozilla/0.96 Beta (X11; Linux 2.6.25.18-0.2-default i686)',
    u'Mozilla/0.91 Beta (Windows)',
    u'Mozilla/0.6 Beta (Windows)',
    u'NetSurf/1.1 (Linux; i686)',
    u'NetSurf/0.0 (RISC OS; armv5l)',
    u'NetSurf/0.0 (Linux; i686)',
    u'Netsurf',
    u'Mozilla/4.7 (compatible; OffByOne; Windows 2000)',
    u'Mozilla/4.7 (compatible; OffByOne; Windows 2000) Webster Pro V3.4',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/531.9+(KHTML, like Gecko, Safari/528.16) OmniWeb/v622.10.0',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.3.0.105198',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.46',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496',
    u'Mozilla/4.5 (compatible; OmniWeb/4.2.1-v435.9; Mac_PowerPC)',
    u'Mozilla/4.5 (compatible; OmniWeb/4.2-v435.2; Mac_PowerPC)',
    u'OmniWeb/2.7-beta-3 OWF/1.0',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20061019 pango-text',
    u'Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.6.30 Version/10.61',
    u'Opera/9.80 (J2ME/MIDP; Opera Mini/5.1.21214/19.916; U; en) Presto/2.5.25',
    u'Opera/9.80 (Windows NT 6.1; U; en) Presto/2.5.24 Version/10.54',
    u'Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; ru) Presto/2.4.18 Version/10.00',
    u'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.22 Version/10.50',
    u'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.5.22 Version/10.50',
    u'Opera/9.80 (X11; Linux x86_64; U; Linux Mint; en) Presto/2.2.15 Version/10.10',
    u'Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.16823/1428; U; en) Presto/2.2.0',
    u'Opera/9.80 (J2ME/MIDP; Opera Mini/4.2.14912/1186; U; en) Presto/2.2.0',
    u'Opera/9.80 (Windows NT 5.2; U; en) Presto/2.2.15 Version/10.10',
    u'Opera/9.80 (X11; Linux i686; U; nl) Presto/2.2.15 Version/10.00',
    u'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.13337/458; U; en) Presto/2.2.0',
    u'Opera/9.60 (J2ME/MIDP; Opera Mini/4.1.11320/608; U; en) Presto/2.2.0',
    u'Opera/10.00 (X11; Linux i686 ; U; en) Presto/2.2.0',
    u'Opera/9.62 (Windows NT 5.1; U; en) Presto/2.1.1',
    u'Opera/9.60 (X11; Linux i686; U; en) Presto/2.1.1',
    u'Opera/9.52 (Windows NT 5.1; U; en)',
    u'Opera/9.25 (Windows NT 6.0; U; en)',
    u'Opera/9.20 (Macintosh; Intel Mac OS X; U; en)',
    u'Opera/9.02 (Windows NT 5.0; U; en)',
    u'Opera/9.00 (Windows NT 4.0; U; en)',
    u'Opera/9.00 (X11; Linux i686; U; en)',
    u'Opera/9.00 (Windows NT 5.1; U; en)',
    u'Opera/9.0 (Windows NT 5.1; U; en)',
    u'Opera/9.0 (Macintosh; PPC Mac OS X; U; en)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.0',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; PPC; 480x640) Opera 8.60 [en]',
    u'Opera/8.5 (Macintosh; PPC Mac OS X; U; en)',
    u'Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en) Opera 8.5',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.5',
    u'Opera/8.0 (Macintosh; PPC Mac OS X; U; en)',
    u'Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en) Opera 8.0',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.0',
    u'Opera/8.01 (Windows NT 5.1)',
    u'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.01',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
    u'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.00',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.00',
    u'Opera/8.00 (Windows NT 5.1; U; en)',
    u'Mozilla/5.0 (X11; Linux i386; U) Opera 7.60  [en-GB]',
    u'Opera/7.60 (Windows NT 5.2; U)  [en] (IBM EVV/3.0/EAK01AG9/LE)',
    u'Opera/7.54 (Windows NT 5.1; U)  [pl]',
    u'Opera/7.50 (X11; Linux i686; U)  [en]',
    u'Mozilla/5.0 (X11; Linux i686; U) Opera 7.50  [en]',
    u'Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686) Opera 7.20  [en]',
    u'Opera/7.11 (Windows NT 5.1; U) [en]',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows ME) Opera 7.11  [en]',
    u'Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]',
    u'Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]',
    u'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]',
    u'Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.01  [en]',
    u'Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0  [en]',
    u'Mozilla/4.01 (Compatible; Acorn Browse 1.25 [23-Oct-97] AW  97; RISC OS 4.39) Acorn-HTTP/0.84',
    u'Mozilla/1.10 [en] (Compatible; RISC OS 3.70; Oregano 1.10)',
    u'Mozilla/1.10 [en] (Compatible; RISC OS 3.70; Oregano 1.10)',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.6) Gecko/20011128',
    u'Mozilla/3.0 (compatible; HP Web PrintSmart 04b0 1.0.1.34)',
    u'Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv: 1.9.1a2pre) Gecko/20080813221937 Prism/0.9.1',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071719 prism/0.8',
    u'Bison/0.02 [fu] (Win67; X; SK)',
    u'retawq/0.1.6 [en] (text)',
    u'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10',
    u'Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21',
    u'Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F136 Safari/525.20',
    u'Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21',
    u'Mozilla/5.0 (iPod; U; CPU iPhone OS 2_0 like Mac OS X; de-de) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.17',
    u'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_2; en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13',
    u'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-gb) AppleWebKit/523.10.6 (KHTML, like Gecko) Version/3.0.4 Safari/523.10.6',
    u'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3',
    u'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+  (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11.1 (KHTML, like Gecko) Version/3.0.3 Safari/522.12.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; bg) AppleWebKit/522.13.1 (KHTML, like Gecko) Version/3.0.2 Safari/522.13.1',
    u'Mozilla/4.0 (compatible; Mozilla/4.0; Mozilla/5.0; Mozilla/6.0; Safari/431.7; Macintosh; U; PPC Mac OS X 10.6 Leopard; AppleWebKit/421.9 (KHTML, like Gecko) )',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru) AppleWebKit/522.11.3(KHTML, like Gecko) Version/3.0 Safari/522.11.3',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419.3 (KHTML, like Gecko) Safari/419.3',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/417.3 (KHTML, like Gecko) Safari/417.2',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/412 (KHTML, like Gecko) Safari/412',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.9 (KHTML, like Gecko) Safari/312.6',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr-fr) AppleWebKit/312.5.1 (KHTML, like Gecko) Safari/312.3.1',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr-fr) AppleWebKit/312.5 (KHTML, like Gecko) Safari/312.3',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/106.2 (KHTML, like Gecko) Safari/100.1',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; es) AppleWebKit/85 (KHTML, like Gecko) Safari/85',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/74 (KHTML, like Gecko) Safari/74',
    u'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/51 (like Gecko) Safari/51',
    u'Mozilla/5.0 (X11; U; OpenVMS AlphaServer_ES40; en-US; rv:1.4) Gecko/20030826 SWB/V1.4 (HP)',
    u'Mozilla/2.0 (Compatible; SIS 1.2; IIgs)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.2pre) Gecko/2009031304 Spicebird/0.7.1',
    u'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.10) Gecko/2009043012 Songbird/1.2.0 (20090616030052)',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008072921 Songbird/0.7.0 (20080819112708)',
    u'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a7pre)  Gecko/2007073021 Songbird/0.3pre (20070731174647)',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060925 Songbird/0.2.5.1 (20070301190953)',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-NZ; rv:1.8.1b2) Gecko/20060925 Songbird/0.2',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060206 Songbird/0.1',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Iron/4.0.280.0 Chrome/4.0.280.0 Safari/532.9',
    u'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Stainless/0.5.5 Safari/525.20.1',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12pre) Gecko/20080101 Strata/4.1.0.1274',
    u'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)',
    u'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Sylera/1.2.7',
    u'W3CLineMode/5.4.0 libwww/5.4.0',
    u'Mozilla/3.0 (compatible; WebCapture 2.0; Auto; Windows)',
    u'Mozilla/4.0 WebTV/2.8 (compatible; MSIE 4.0)',
    u'w3m/0.5.1',
    u'w3m/0.4.1',
    u'Wget/1.8.1',
    u'Wget/1.6',
    u'Xenu_Link_Sleuth_1.2d',
    u'netmath',
    u'Mozilla/1.10 [en] (Compatible; RISC OS 3.70; Oregano 1.10)',
    u'Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/)',
    u'xChaos_Arachne/5.1.89;GPL,386+',
    u'..FunWebSearch...',
    u'Mozilla/4.0 (compatible; Powermarks/3.5; Windows 95/98/2000/NT)',
    u'Mozilla/5.0 (compatible; IDZap)',
    u'WDG_Validator/1.6.1',
    u'Bobby/4.0.1 RPT-HTTPClient/0.3-3E',
    u'W3C_Validator/1.183 libwww-perl/5.64',
    u'vobsub',
    u'DigExt',
    u'...SURF...',
    u'Mozilla/4.01 (Compatible; Acorn Phoenix 2.08 [intermediate]; RISC OS 4.39) Acorn-HTTP/0.84',
    u'mozilla/4.0 (compatible; msie 6.0; windows 98; ypc 3.0.2; yplus 4.4.01d)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET CLR 1.1.4322)',
    u'Mozilla/4.5 RPT-HTTPClient/0.3-2',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; KTXN)',
    u'SUNPlex 4.1 (Trusted Solaris 8 Operating Environment; Solaris 8 OE; Sun Fire 15K)',
    u'Mozilla/3.0 (compatible; HP Web PrintSmart 04b0 1.0.1.34)',
    u'Mozilla/4.0 (compatible; MSIE 5.0; Win3.1; ATHMWWW1.1;)',
    u'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)',
    u'Mozilla/4.0 (compatible; ICS 1.2.105)',
    u'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux'
]

def get_browser_details(user_agent):
    ua_long = re.compile(r'([-a-zA-Z0-9_ ]*)/([0-9]*\.[0-9]*)(?:[ ]?\(([-a-zA-Z0-9 :;,._/()]*)\)[ ]?([a-zA-Z0-9 /.,()]*))')
    ua_short = re.compile(r'([-a-zA-Z0-9_ ]*)/([0-9]*\.[0-9]*)(?:[ ]\((.*?)\))')
    ua_match = ua_long.match(user_agent)
    details = []
    if ua_match:
        details = ua_match.group(3).split(u';')
        browser = {
            u'user_agent': user_agent,
            u'app_name': ua_match.group(1),
            u'app_version': ua_match.group(2),
            u'details': details,
            u'compatible': details[0].strip() if len(details) > 0 else u'',
            u'version': details[1].strip() if len(details) > 1 else u'',
            u'platform': details[2].strip() if len(details) > 2 else u'',
            u'language': details[3].strip() if len(details) > 3 else u'',
            u'browser': u'Unknown'
        }
    else:
        ua_match = ua_short.match(user_agent)
        if ua_match:
            details = ua_match.group(3).split(u';')
            browser = {
                u'user_agent': user_agent,
                u'app_name': ua_match.group(1),
                u'app_version': ua_match.group(2),
                u'details': details,
                u'version': ua_match.group(2)
            }
        else:
            return False
    if browser[u'app_name'] == u'Opera':
        browser[u'browser'] = u'Opera'
        browser[u'version'] = browser[u'app_version']
    elif browser[u'app_name'] == u'amaya':
        browser[u'browser'] = u'Amaya'
        browser[u'version'] = browser[u'app_version']
    elif browser[u'app_name'] == u'curl':
        browser[u'browser'] = u'cURL'
        browser[u'version'] = browser[u'app_version']
    elif browser[u'app_name'] == u'Dillo':
        browser[u'browser'] = u'Dillo'
        browser[u'version'] = browser[u'app_version']
    elif browser[u'app_name'] == u'Elinks':
        browser[u'browser'] = u'Elinks'
        browser[u'version'] = browser[u'app_version']
    elif len(ua_match.groups()) > 3 and len(details) > 1 and details[1].find(u'MSIE') > -1:
        browser[u'browser'] = u'Internet Explorer'
        match = re.search(r'MSIE ([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and len(details) > 1 and details[1].find(u'Konqueror') > -1:
        browser[u'browser'] = u'Konqueror'
        match = re.search(r'Konqueror/([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Comodo_Dragon') > -1:
        browser[u'browser'] = u'Comodo_Dragon (security-enhanced version of Chrome)'
        match = re.search(r'Comodo_Dragon/([-a-zA-Z0-9.,]*) ', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Chromium') > -1:
        browser[u'browser'] = u'Chromium (development version of Chrome)'
        match = re.search(r'Chromium/([-a-zA-Z0-9.,]*) ', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Chrome') > -1:
        browser[u'browser'] = u'Chrome'
        match = re.search(r'Chrome/([-a-zA-Z0-9.,]*) ', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Arora') > -1:
        browser[u'browser'] = u'Arora'
        match = re.search(r'Arroa/([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'midori') > -1:
        browser[u'browser'] = u'Midori'
        match = re.search(r'Safari/([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'rekonq') > -1:
        browser[u'browser'] = u'Rekonq'
        match = re.search(r'Safari/([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Safari') > -1:
        browser[u'browser'] = u'Safari'
        match = re.search(r'Safari/([-a-zA-Z0-9.,]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Epiphany') > -1:
        browser[u'browser'] = u'Epiphany'
        match = re.search(r'Epiphany/([-a-zA-Z0-9.,]*) ', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Camino') > -1:
        browser[u'browser'] = u'Camino'
        match = re.search(r'Camino/([-a-zA-Z0-9., ]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Flock') > -1:
        browser[u'browser'] = u'Flock (social browser based on Firefox)'
        match = re.search(r'Flock/([-a-zA-Z0-9., ]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'Firefox') > -1:
        browser[u'browser'] = u'Firefox'
        match = re.search(r'Firefox/([-a-zA-Z0-9., ]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    elif len(ua_match.groups()) > 3 and ua_match.group(4).find(u'SeaMonkey') > -1:
        browser[u'browser'] = u'SeaMonkey'
        match = re.search(r'SeaMonkey/([-a-zA-Z0-9., ]*)', ua_match.group(4))
        if match:
            browser[u'version'] = match.group(1)
    else:
        browser[u'browser'] = browser[u'app_name']
    return browser

if __name__ == u'__main__':
    for ua_string in USER_AGENTS:
        browser = get_browser_details(ua_string)
        if not browser:
            print u'Failed to identify:', ua_string
        else:
            print u'Browser: %s, version %s (%s)' % (browser[u'browser'], browser[u'version'], browser[u'app_version'])