Permalink
Browse files

more devices

  • Loading branch information...
1 parent 995ffde commit 24bd4958539775d0ee5e64efb118c6fe2123691c @daleobrien daleobrien committed Feb 27, 2012
Showing with 11 additions and 3 deletions.
  1. +5 −2 minidetector/__init__.py
  2. +6 −1 minidetector/tests/mobile_useragents.txt
View
@@ -40,12 +40,15 @@ def process_request(request):
try:
if s.find("iphone") > 0:
try:
- device['iphone'] = "iphone" + re.search("iphone os (\d)", s).groups(0)[0]
+ device['iphone'] = "iphone" + re.search("os (\d_\d)", s).groups(0)[0]
except:
device['iphone'] = "iphone" + re.search("version/(\d\.\d)", s).groups(0)[0]
if s.find("ipad") > 0:
- device['ipad'] = "ipad"
+ device['ipad'] = "ipad" + re.search("os (\d_\d)", s).groups(0)[0]
+
+ if s.find("ipod") > 0:
+ device['ipod'] = "ipad"
if s.find("android") > 0:
device['android'] = "android" + re.search("android (\d\.\d)", s).groups(0)[0].translate(None, '.')
@@ -142,7 +142,6 @@ Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [en]
Mozilla/5.0 (PLAYSTATION 3; 1.00)
Mozilla/4.0 (PSP (PlayStation Portable); 2.00)
Mozilla/4.0 WebTV/2.8 (compatible; MSIE 4.0)
-Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3
Mozilla/4.0 (PS2; PlayStation BB Navigator 1.0) NetFront/3.0
Opera/9.10 (Nintendo Wii; U; ; 1621; en)
Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; PPC; 480x640) Opera 8.60 [en]
@@ -166,3 +165,9 @@ Mozilla/5.0 (Series40; NokiaX3-02/06.00; Profile/MIDP-2.1 Configuration/CLDC-1.1
Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13
Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 800)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7)
+Mozilla/5.0 (iPhone; 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
+Mozilla/5.0 (iPhone; U; CPU iOS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/XXXXX Safari/525.20
+Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3
+Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
+Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3
+Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3

0 comments on commit 24bd495

Please sign in to comment.