user_agent_parser 0.1.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of user_agent_parser might be problematic. Click here for more details.

@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Tim Lucas
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,76 @@
1
+ # UserAgentParser [![Build Status](https://secure.travis-ci.org/toolmantim/user_agent_parser.png?branch=master)](http://travis-ci.org/toolmantim/user_agent_parser)
2
+
3
+ UserAgentParser is a simple, comprehensive Ruby gem for parsing user agent strings. It uses [BrowserScope](http://www.browserscope.org/)'s [parsing patterns](https://github.com/tobie/ua-parser).
4
+
5
+ ## Requirements
6
+
7
+ * Ruby >= 1.9.2
8
+
9
+ Note: Ruby 1.8.7 is not supported due to the requirement for the newer psych YAML parser. If you can get it working on 1.8.7 please send a pull request.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ $ gem install user_agent_parser
15
+ ```
16
+
17
+ ## Example usage
18
+
19
+ ```ruby
20
+ require 'user_agent_parser'
21
+ => true
22
+ ua = UserAgentParser.parse 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0;)'
23
+ => #<UserAgentParser::UserAgent IE 9.0 (Windows Vista)>
24
+ ua.to_s
25
+ => "IE 9.0"
26
+ ua.family
27
+ => "IE"
28
+ ua.version.to_s
29
+ => "9.0"
30
+ ua.version.major
31
+ => 9
32
+ ua.version.minor
33
+ => 0
34
+ os = ua.os
35
+ => #<UserAgentParser::OperatingSystem Windows Vista>
36
+ os.to_s
37
+ => "Windows Vista"
38
+ ```
39
+
40
+ ## The pattern database
41
+
42
+ The [ua-parser database](https://github.com/tobie/ua-parser/blob/master/regexes.yaml) is included via a [git submodule](http://help.github.com/submodules/). To update the database the submodule needs to be updated and the gem re-released (pull requests for this are very welcome!).
43
+
44
+ You can also specify the path to your own, updated and/or customised `regexes.yaml` file:
45
+
46
+ ```ruby
47
+ UserAgentParser.patterns_path = '/some/path/to/regexes.yaml'
48
+ ```
49
+
50
+ ## Comprehensive you say?
51
+
52
+ ```bash
53
+ $ rake test
54
+ ...
55
+
56
+ Finished tests in 144.220280s, 89.0027 tests/s, 234.9739 assertions/s.
57
+
58
+ 12836 tests, 33888 assertions, 0 failures, 0 errors, 0 skips
59
+ ```
60
+
61
+ ## Limitations
62
+
63
+ There's no support for providing overrides from Javascript user agent detection like there is with original BrowserScope library. The Javascript overrides were only necessary for detecting IE 9 Platform Preview and older versions of [Chrome Frame](https://developers.google.com/chrome/chrome-frame/).
64
+
65
+ ## Contributing
66
+
67
+ 1. Fork
68
+ 2. Hack
69
+ 3. `rake test`
70
+ 4. Send a pull request
71
+
72
+ All accepted pull requests will earn you commit and release rights.
73
+
74
+ ## License
75
+
76
+ MIT
@@ -13,7 +13,7 @@ module UserAgentParser
13
13
  private
14
14
 
15
15
  def all_patterns
16
- @all_patterns ||= YAML.load(File.read(UserAgentParser.patterns_path))
16
+ @all_patterns ||= YAML.load_file(UserAgentParser.patterns_path)
17
17
  end
18
18
 
19
19
  def patterns type
@@ -13,12 +13,13 @@ module UserAgentParser
13
13
  def to_s
14
14
  s = family
15
15
  s += " #{version}" if version
16
- s += " (#{os})" if os
17
16
  s
18
17
  end
19
18
 
20
19
  def inspect
21
- "#<#{self.class} #{to_s}>"
20
+ s = to_s
21
+ s += " (#{os})" if os
22
+ "#<#{self.class} #{s}>"
22
23
  end
23
24
 
24
25
  def ==(other)
@@ -18,6 +18,11 @@ module UserAgentParser
18
18
  def [](segment)
19
19
  segments[segment]
20
20
  end
21
+
22
+ def major; self[0] end
23
+ def minor; self[1] end
24
+ def patch; self[2] end
25
+ def patch_minor; self[3] end
21
26
 
22
27
  def inspect
23
28
  "#<#{self.class} #{to_s}>"
@@ -0,0 +1,870 @@
1
+ user_agent_parsers:
2
+ #### SPECIAL CASES TOP ####
3
+
4
+ # must go before Opera
5
+ - regex: '^(Opera)/(\d+)\.(\d+) \(Nintendo Wii'
6
+ family_replacement: 'Wii'
7
+
8
+ # must go before Firefox to catch SeaMonkey/Camino
9
+ - regex: '(SeaMonkey|Camino)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*)'
10
+
11
+ # Firefox
12
+ - regex: '(Pale[Mm]oon)/(\d+)\.(\d+)\.?(\d+)?'
13
+ family_replacement: 'Pale Moon (Firefox Variant)'
14
+ - regex: '(Fennec)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*)'
15
+ family_replacement: 'Firefox Mobile'
16
+ - regex: '(Fennec)/(\d+)\.(\d+)(pre)'
17
+ family_replacement: 'Firefox Mobile'
18
+ - regex: '(Fennec)/(\d+)\.(\d+)'
19
+ family_replacement: 'Firefox Mobile'
20
+ - regex: 'Mobile.*(Firefox)/(\d+)\.(\d+)'
21
+ family_replacement: 'Firefox Mobile'
22
+ - regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)\.(\d+(?:pre)?)'
23
+ family_replacement: 'Firefox ($1)'
24
+ - regex: '(Firefox)/(\d+)\.(\d+)(a\d+[a-z]*)'
25
+ family_replacement: 'Firefox Alpha'
26
+ - regex: '(Firefox)/(\d+)\.(\d+)(b\d+[a-z]*)'
27
+ family_replacement: 'Firefox Beta'
28
+ - regex: '(Firefox)-(?:\d+\.\d+)?/(\d+)\.(\d+)(a\d+[a-z]*)'
29
+ family_replacement: 'Firefox Alpha'
30
+ - regex: '(Firefox)-(?:\d+\.\d+)?/(\d+)\.(\d+)(b\d+[a-z]*)'
31
+ family_replacement: 'Firefox Beta'
32
+ - regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)([ab]\d+[a-z]*)?'
33
+ family_replacement: 'Firefox ($1)'
34
+ - regex: '(Firefox).*Tablet browser (\d+)\.(\d+)\.(\d+)'
35
+ family_replacement: 'MicroB'
36
+ - regex: '(MozillaDeveloperPreview)/(\d+)\.(\d+)([ab]\d+[a-z]*)?'
37
+
38
+ # e.g.: Flock/2.0b2
39
+ - regex: '(Flock)/(\d+)\.(\d+)(b\d+?)'
40
+
41
+ # RockMelt
42
+ - regex: '(RockMelt)/(\d+)\.(\d+)\.(\d+)'
43
+
44
+ # e.g.: Fennec/0.9pre
45
+ - regex: '(Navigator)/(\d+)\.(\d+)\.(\d+)'
46
+ family_replacement: 'Netscape'
47
+
48
+ - regex: '(Navigator)/(\d+)\.(\d+)([ab]\d+)'
49
+ family_replacement: 'Netscape'
50
+
51
+ - regex: '(Netscape6)/(\d+)\.(\d+)\.(\d+)'
52
+ family_replacement: 'Netscape'
53
+
54
+ - regex: '(MyIBrow)/(\d+)\.(\d+)'
55
+ family_replacement: 'My Internet Browser'
56
+
57
+ # Opera will stop at 9.80 and hide the real version in the Version string.
58
+ # see: http://dev.opera.com/articles/view/opera-ua-string-changes/
59
+ - regex: '(Opera Tablet).*Version/(\d+)\.(\d+)(?:\.(\d+))?'
60
+ - regex: '(Opera)/.+Opera Mobi.+Version/(\d+)\.(\d+)'
61
+ family_replacement: 'Opera Mobile'
62
+ - regex: 'Opera Mobi'
63
+ family_replacement: 'Opera Mobile'
64
+ - regex: '(Opera Mini)/(\d+)\.(\d+)'
65
+ - regex: '(Opera Mini)/att/(\d+)\.(\d+)'
66
+ - regex: '(Opera)/9.80.*Version/(\d+)\.(\d+)(?:\.(\d+))?'
67
+
68
+ # Palm WebOS looks a lot like Safari.
69
+ - regex: '(webOSBrowser)/(\d+)\.(\d+)'
70
+ - regex: '(webOS)/(\d+)\.(\d+)'
71
+ family_replacement: 'webOSBrowser'
72
+ - regex: '(wOSBrowser).+TouchPad/(\d+)\.(\d+)'
73
+ family_replacement: 'webOS TouchPad'
74
+
75
+ # LuaKit has no version info.
76
+ # http://luakit.org/projects/luakit/
77
+ - regex: '(luakit)'
78
+ family_replacement: 'LuaKit'
79
+
80
+ # Lightning (for Thunderbird)
81
+ # http://www.mozilla.org/projects/calendar/lightning/
82
+ - regex: '(Lightning)/(\d+)\.(\d+)([ab]?\d+[a-z]*)'
83
+
84
+ # Swiftfox
85
+ - regex: '(Firefox)/(\d+)\.(\d+)\.(\d+(?:pre)?) \(Swiftfox\)'
86
+ family_replacement: 'Swiftfox'
87
+ - regex: '(Firefox)/(\d+)\.(\d+)([ab]\d+[a-z]*)? \(Swiftfox\)'
88
+ family_replacement: 'Swiftfox'
89
+
90
+ # Rekonq
91
+ - regex: '(rekonq)/(\d+)\.(\d+) Safari'
92
+ family_replacement: 'Rekonq'
93
+ - regex: 'rekonq'
94
+ family_replacement: 'Rekonq'
95
+
96
+ # Conkeror lowercase/uppercase
97
+ # http://conkeror.org/
98
+ - regex: '(conkeror|Conkeror)/(\d+)\.(\d+)\.?(\d+)?'
99
+ family_replacement: 'Conkeror'
100
+
101
+ # catches lower case konqueror
102
+ - regex: '(konqueror)/(\d+)\.(\d+)\.(\d+)'
103
+ family_replacement: 'Konqueror'
104
+
105
+ - regex: '(WeTab)-Browser'
106
+
107
+ - regex: '(Comodo_Dragon)/(\d+)\.(\d+)\.(\d+)'
108
+ family_replacement: 'Comodo Dragon'
109
+
110
+ # Bots
111
+ - regex: '(YottaaMonitor|BrowserMob|HttpMonitor|YandexBot|Slurp|BingPreview|PagePeeker|ThumbShotsBot|WebThumb|URL2PNG|ZooShot|GomezA|Catchpoint bot|Willow Internet Crawler|Google SketchUp|Read%20Later)'
112
+
113
+ # must go before NetFront below
114
+ - regex: '(Kindle)/(\d+)\.(\d+)'
115
+
116
+ - regex: '(Symphony) (\d+).(\d+)'
117
+
118
+ - regex: '(Minimo)'
119
+
120
+ # Chrome Mobile
121
+ - regex: '(CrMo)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
122
+ family_replacement: 'Chrome Mobile'
123
+ - regex: '(CriOS)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
124
+ family_replacement: 'Chrome Mobile iOS'
125
+ - regex: '(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+) Mobile'
126
+ family_replacement: 'Chrome Mobile'
127
+
128
+ # Chrome Frame must come before MSIE.
129
+ - regex: '(chromeframe)/(\d+)\.(\d+)\.(\d+)'
130
+ family_replacement: 'Chrome Frame'
131
+
132
+ # UC Browser
133
+ - regex: '(UC Browser)(\d+)\.(\d+)\.(\d+)'
134
+
135
+ # Tizen Browser (second case included in browser/major.minor regex)
136
+ - regex: '(SLP Browser)/(\d+)\.(\d+)'
137
+ family_replacement: 'Tizen Browser'
138
+
139
+ # Epiphany browser (identifies as Chromium)
140
+ - regex: '(Epiphany)/(\d+)\.(\d+).(\d+)'
141
+
142
+ # Sogou Explorer 2.X
143
+ - regex: '(SE 2\.X) MetaSr (\d+)\.(\d+)'
144
+ family_replacement: 'Sogou Explorer'
145
+
146
+ # Baidu Browser
147
+ - regex: '(FlyFlow)/(\d+)\.(\d+)'
148
+ family_replacement: 'Baidu Explorer'
149
+
150
+ # Pingdom
151
+ - regex: '(Pingdom.com_bot_version_)(\d+)\.(\d+)'
152
+ family_replacement: 'PingdomBot'
153
+
154
+ # Facebook
155
+ - regex: '(facebookexternalhit)/(\d+)\.(\d+)'
156
+ family_replacement: 'FacebookBot'
157
+
158
+ # Twitterbot
159
+ - regex: '(Twitterbot)/(\d+)\.(\d+)'
160
+ family_replacement: 'TwitterBot'
161
+
162
+ # PyAMF
163
+ - regex: '(PyAMF)/(\d+)\.(\d+)\.(\d+)'
164
+
165
+ #### END SPECIAL CASES TOP ####
166
+
167
+ #### MAIN CASES - this catches > 50% of all browsers ####
168
+
169
+ # Browser/major_version.minor_version.beta_version
170
+ - regex: '(AdobeAIR|Chromium|FireWeb|Jasmine|ANTGalio|Midori|Fresco|Lobo|PaleMoon|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Shiira|Sunrise|Chrome|Flock|Netscape|Lunascape|WebPilot|Vodafone|NetFront|Netfront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|ThunderBrowse|Iris|UP\.Browser|Bunjaloo|Google Earth|Raven for Mac)/(\d+)\.(\d+)\.(\d+)'
171
+
172
+ # Browser/major_version.minor_version
173
+ - regex: '(Bolt|Jasmine|IceCat|Skyfire|Midori|Maxthon|Lynx|Arora|IBrowse|Dillo|Camino|Shiira|Fennec|Phoenix|Chrome|Flock|Netscape|Lunascape|Epiphany|WebPilot|Opera Mini|Opera|Vodafone|NetFront|Netfront|Konqueror|Googlebot|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|iCab|NetNewsWire|Space Bison|Stainless|Orca|Dolfin|BOLT|Minimo|Tizen Browser|Polaris|Abrowser)/(\d+)\.(\d+)'
174
+
175
+ # Browser major_version.minor_version.beta_version (space instead of slash)
176
+ - regex: '(iRider|Crazy Browser|SkipStone|iCab|Lunascape|Sleipnir|Maemo Browser) (\d+)\.(\d+)\.(\d+)'
177
+ # Browser major_version.minor_version (space instead of slash)
178
+ - regex: '(iCab|Lunascape|Opera|Android|Jasmine|Polaris|BREW) (\d+)\.(\d+)\.?(\d+)?'
179
+
180
+ # weird android UAs
181
+ - regex: '(Android) Donut'
182
+ v1_replacement: '1'
183
+ v2_replacement: '2'
184
+
185
+ - regex: '(Android) Eclair'
186
+ v1_replacement: '2'
187
+ v2_replacement: '1'
188
+
189
+ - regex: '(Android) Froyo'
190
+ v1_replacement: '2'
191
+ v2_replacement: '2'
192
+
193
+ - regex: '(Android) Gingerbread'
194
+ v1_replacement: '2'
195
+ v2_replacement: '3'
196
+
197
+ - regex: '(Android) Honeycomb'
198
+ v1_replacement: '3'
199
+
200
+ # IE Mobile
201
+ - regex: '(IEMobile)[ /](\d+)\.(\d+)'
202
+ family_replacement: 'IE Mobile'
203
+ # desktop mode
204
+ # http://www.anandtech.com/show/3982/windows-phone-7-review
205
+ - regex: '(MSIE) (\d+)\.(\d+).*XBLWP7'
206
+ family_replacement: 'IE Large Screen'
207
+
208
+ # AFTER THE EDGE CASES ABOVE!
209
+ - regex: '(Firefox)/(\d+)\.(\d+)\.(\d+)'
210
+ - regex: '(Firefox)/(\d+)\.(\d+)(pre|[ab]\d+[a-z]*)?'
211
+
212
+ #### END MAIN CASES ####
213
+
214
+ #### SPECIAL CASES ####
215
+ - regex: '(Obigo)InternetBrowser'
216
+ - regex: '(Obigo)\-Browser'
217
+ - regex: '(Obigo|OBIGO)[^\d]*(\d+)(?:.(\d+))?'
218
+
219
+ - regex: '(MAXTHON|Maxthon) (\d+)\.(\d+)'
220
+ family_replacement: 'Maxthon'
221
+ - regex: '(Maxthon|MyIE2|Uzbl|Shiira)'
222
+ v1_replacement: '0'
223
+
224
+ - regex: '(PLAYSTATION) (\d+)'
225
+ family_replacement: 'PlayStation'
226
+ - regex: '(PlayStation Portable)[^\d]+(\d+).(\d+)'
227
+
228
+ - regex: '(BrowseX) \((\d+)\.(\d+)\.(\d+)'
229
+
230
+ # Polaris/d.d is above
231
+ - regex: '(POLARIS)/(\d+)\.(\d+)'
232
+ family_replacement: 'Polaris'
233
+ - regex: '(Embider)/(\d+)\.(\d+)'
234
+ family_replacement: 'Polaris'
235
+
236
+ - regex: '(BonEcho)/(\d+)\.(\d+)\.(\d+)'
237
+ family_replacement: 'Bon Echo'
238
+
239
+ - regex: '(iPod).+Version/(\d+)\.(\d+)\.(\d+)'
240
+ family_replacement: 'Mobile Safari'
241
+ - regex: '(iPod).*Version/(\d+)\.(\d+)'
242
+ family_replacement: 'Mobile Safari'
243
+ - regex: '(iPhone).*Version/(\d+)\.(\d+)\.(\d+)'
244
+ family_replacement: 'Mobile Safari'
245
+ - regex: '(iPhone).*Version/(\d+)\.(\d+)'
246
+ family_replacement: 'Mobile Safari'
247
+ - regex: '(iPad).*Version/(\d+)\.(\d+)\.(\d+)'
248
+ family_replacement: 'Mobile Safari'
249
+ - regex: '(iPad).*Version/(\d+)\.(\d+)'
250
+ family_replacement: 'Mobile Safari'
251
+ - regex: '(iPod|iPhone|iPad);.*CPU.*OS (\d+)(?:_\d+)?_(\d+).*Mobile'
252
+ family_replacement: 'Mobile Safari'
253
+ - regex: '(iPod|iPhone|iPad)'
254
+ family_replacement: 'Mobile Safari'
255
+
256
+ - regex: '(AvantGo) (\d+).(\d+)'
257
+
258
+ - regex: '(Avant)'
259
+ v1_replacement: '1'
260
+
261
+ # nokia browsers
262
+ # based on: http://www.developer.nokia.com/Community/Wiki/User-Agent_headers_for_Nokia_devices
263
+ - regex: '^(Nokia)'
264
+ family_replacement: 'Nokia Services (WAP) Browser'
265
+ - regex: '(NokiaBrowser)/(\d+)\.(\d+).(\d+)\.(\d+)'
266
+ - regex: '(NokiaBrowser)/(\d+)\.(\d+).(\d+)'
267
+ - regex: '(NokiaBrowser)/(\d+)\.(\d+)'
268
+ - regex: '(BrowserNG)/(\d+)\.(\d+).(\d+)'
269
+ family_replacement: 'NokiaBrowser'
270
+ - regex: '(Series60)/5\.0'
271
+ family_replacement: 'NokiaBrowser'
272
+ v1_replacement: '7'
273
+ v2_replacement: '0'
274
+ - regex: '(Series60)/(\d+)\.(\d+)'
275
+ family_replacement: 'Nokia OSS Browser'
276
+ - regex: '(S40OviBrowser)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
277
+ family_replacement: 'Nokia Series 40 Ovi Browser'
278
+ - regex: '(Nokia)[EN]?(\d+)'
279
+
280
+ # BlackBerry devices
281
+ - regex: '(PlayBook).+RIM Tablet OS (\d+)\.(\d+)\.(\d+)'
282
+ family_replacement: 'Blackberry WebKit'
283
+ - regex: '(Black[bB]erry).+Version/(\d+)\.(\d+)\.(\d+)'
284
+ family_replacement: 'Blackberry WebKit'
285
+ - regex: '(Black[bB]erry)\s?(\d+)'
286
+ family_replacement: 'Blackberry'
287
+
288
+ - regex: '(OmniWeb)/v(\d+)\.(\d+)'
289
+
290
+ - regex: '(Blazer)/(\d+)\.(\d+)'
291
+ family_replacement: 'Palm Blazer'
292
+
293
+ - regex: '(Pre)/(\d+)\.(\d+)'
294
+ family_replacement: 'Palm Pre'
295
+
296
+ - regex: '(Links) \((\d+)\.(\d+)'
297
+
298
+ - regex: '(QtWeb) Internet Browser/(\d+)\.(\d+)'
299
+
300
+ #- regex: '\(iPad;.+(Version)/(\d+)\.(\d+)(?:\.(\d+))?.*Safari/'
301
+ # family_replacement: 'iPad'
302
+
303
+ # Amazon Silk, should go before Safari
304
+ - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+))?'
305
+
306
+ # WebKit Nightly
307
+ - regex: '(AppleWebKit)/(\d+)\.?(\d+)?\+ .* Safari'
308
+ family_replacement: 'WebKit Nightly'
309
+
310
+ # Safari
311
+ - regex: '(Version)/(\d+)\.(\d+)(?:\.(\d+))?.*Safari/'
312
+ family_replacement: 'Safari'
313
+ # Safari didn't provide "Version/d.d.d" prior to 3.0
314
+ - regex: '(Safari)/\d+'
315
+
316
+ - regex: '(OLPC)/Update(\d+)\.(\d+)'
317
+
318
+ - regex: '(OLPC)/Update()\.(\d+)'
319
+ v1_replacement: '0'
320
+
321
+ - regex: '(SEMC\-Browser)/(\d+)\.(\d+)'
322
+
323
+ - regex: '(Teleca)'
324
+ family_replacement: 'Teleca Browser'
325
+
326
+ - regex: '(MSIE) (\d+)\.(\d+)'
327
+ family_replacement: 'IE'
328
+
329
+ - regex: '(Nintendo 3DS).* Version/(\d+)\.(\d+)(?:\.(\w+))'
330
+
331
+ os_parsers:
332
+
333
+ ##########
334
+ # Android
335
+ # can actually detect rooted android os. do we care?
336
+ ##########
337
+ - regex: '(Android) (\d+)\.(\d+)(?:[.\-]([a-z0-9]+))?'
338
+ - regex: '(Android)\-(\d+)\.(\d+)(?:[.\-]([a-z0-9]+))?'
339
+
340
+ - regex: '(Android) Donut'
341
+ os_v1_replacement: '1'
342
+ os_v2_replacement: '2'
343
+
344
+ - regex: '(Android) Eclair'
345
+ os_v1_replacement: '2'
346
+ os_v2_replacement: '1'
347
+
348
+ - regex: '(Android) Froyo'
349
+ os_v1_replacement: '2'
350
+ os_v2_replacement: '2'
351
+
352
+ - regex: '(Android) Gingerbread'
353
+ os_v1_replacement: '2'
354
+ os_v2_replacement: '3'
355
+
356
+ - regex: '(Android) Honeycomb'
357
+ os_v1_replacement: '3'
358
+
359
+ ##########
360
+ # Windows
361
+ # http://en.wikipedia.org/wiki/Windows_NT#Releases
362
+ # possibility of false positive when different marketing names share same NT kernel
363
+ # e.g. windows server 2003 and windows xp
364
+ # lots of ua strings have Windows NT 4.1 !?!?!?!? !?!? !? !????!?! !!! ??? !?!?! ?
365
+ # (very) roughly ordered in terms of frequency of occurence of regex (win xp currently most frequent, etc)
366
+ ##########
367
+ - regex: '(Windows Phone 6\.5)'
368
+
369
+ - regex: '(Windows (?:NT 5\.2|NT 5\.1))'
370
+ os_replacement: 'Windows XP'
371
+
372
+ # ie mobile des ktop mode
373
+ # spoofs nt 6.1. must come before windows 7
374
+ - regex: '(XBLWP7)'
375
+ os_replacement: 'Windows Phone OS'
376
+
377
+ - regex: '(Windows NT 6\.1)'
378
+ os_replacement: 'Windows 7'
379
+
380
+ - regex: '(Windows NT 6\.0)'
381
+ os_replacement: 'Windows Vista'
382
+
383
+ - regex: '(Windows 98|Windows XP|Windows ME|Windows 95|Windows CE|Windows 7|Windows NT 4\.0|Windows Vista|Windows 2000)'
384
+
385
+ # is this a spoof or is nt 6.2 out and about in some capacity?
386
+ - regex: '(Windows NT 6\.2)'
387
+ os_replacement: 'Windows 8'
388
+
389
+ - regex: '(Windows NT 5\.0)'
390
+ os_replacement: 'Windows 2000'
391
+
392
+ - regex: '(Windows Phone OS) (\d+)\.(\d+)'
393
+
394
+ - regex: '(Windows ?Mobile)'
395
+ os_replacement: 'Windows Mobile'
396
+
397
+ - regex: '(WinNT4.0)'
398
+ os_replacement: 'Windows NT 4.0'
399
+
400
+ - regex: '(Win98)'
401
+ os_replacement: 'Windows 98'
402
+
403
+ ##########
404
+ # Tizen OS from Samsung
405
+ # spoofs Android so pushing it above
406
+ ##########
407
+ - regex: '(Tizen)/(\d+)\.(\d+)'
408
+
409
+
410
+
411
+ ##########
412
+ # Mac OS
413
+ # http://en.wikipedia.org/wiki/Mac_OS_X#Versions
414
+ ##########
415
+ - regex: '(Mac OS X) (\d+)[_.](\d+)(?:[_.](\d+))?'
416
+
417
+ # builds before tiger don't seem to specify version?
418
+
419
+ # ios devices spoof (mac os x), so including intel/ppc prefixes
420
+ - regex: '(?:PPC|Intel) (Mac OS X)'
421
+
422
+ ##########
423
+ # iOS
424
+ # http://en.wikipedia.org/wiki/IOS_version_history
425
+ ##########
426
+ - regex: '(CPU OS|iPhone OS) (\d+)_(\d+)(?:_(\d+))?'
427
+ os_replacement: 'iOS'
428
+
429
+ # remaining cases are mostly only opera uas, so catch opera as to not catch iphone spoofs
430
+ - regex: '(iPhone|iPad|iPod); Opera'
431
+ os_replacement: 'iOS'
432
+
433
+ # few more stragglers
434
+ - regex: '(iPhone|iPad|iPod).*Mac OS X.*Version/(\d+)\.(\d+)'
435
+ os_replacement: 'iOS'
436
+
437
+ - regex: '(AppleTV)/(\d+)\.(\d+)'
438
+ os_replacement: 'ATV OS X'
439
+ os_v1_replacement: '$1'
440
+ os_v2_replacement: '$2'
441
+
442
+ ##########
443
+ # Chrome OS
444
+ # if version 0.0.0, probably this stuff:
445
+ # http://code.google.com/p/chromium-os/issues/detail?id=11573
446
+ # http://code.google.com/p/chromium-os/issues/detail?id=13790
447
+ ##########
448
+ - regex: '(CrOS) [a-z0-9_]+ (\d+)\.(\d+)(?:\.(\d+))?'
449
+ os_replacement: 'Chrome OS'
450
+
451
+ ##########
452
+ # Linux distros
453
+ ##########
454
+ - regex: '(Debian)-(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
455
+ - regex: '(Linux Mint)(?:/(\d+))?'
456
+ - regex: '(Mandriva)(?: Linux)?/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
457
+
458
+ ##########
459
+ # Symbian + Symbian OS
460
+ # http://en.wikipedia.org/wiki/History_of_Symbian
461
+ ##########
462
+ - regex: '(Symbian[Oo][Ss])/(\d+)\.(\d+)'
463
+ os_replacement: 'Symbian OS'
464
+ - regex: '(Symbian/3).+NokiaBrowser/7\.3'
465
+ os_replacement: 'Symbian^3 Anna'
466
+ - regex: '(Symbian/3).+NokiaBrowser/7\.4'
467
+ os_replacement: 'Symbian^3 Belle'
468
+ - regex: '(Symbian/3)'
469
+ os_replacement: 'Symbian^3'
470
+ - regex: '(Series 60|SymbOS|S60)'
471
+ os_replacement: 'Symbian OS'
472
+ - regex: '(MeeGo)'
473
+ - regex: 'Symbian [Oo][Ss]'
474
+ os_replacement: 'Symbian OS'
475
+
476
+ ##########
477
+ # BlackBerry devices
478
+ ##########
479
+ - regex: '(Black[Bb]erry)[0-9a-z]+/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
480
+ os_replacement: 'BlackBerry OS'
481
+ - regex: '(Black[Bb]erry).+Version/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
482
+ os_replacement: 'BlackBerry OS'
483
+ - regex: '(RIM Tablet OS) (\d+)\.(\d+)\.(\d+)'
484
+ os_replacement: 'BlackBerry Tablet OS'
485
+ - regex: '(Play[Bb]ook)'
486
+ os_replacement: 'BlackBerry Tablet OS'
487
+ - regex: '(Black[Bb]erry)'
488
+ os_replacement: 'Blackberry OS'
489
+
490
+ ##########
491
+ # Google TV
492
+ ##########
493
+ - regex: '(GoogleTV) (\d+)\.(\d+)\.(\d+)'
494
+ # Old style
495
+ - regex: '(GoogleTV)\/\d+'
496
+
497
+ ##########
498
+ # Misc mobile
499
+ ##########
500
+ - regex: '(webOS|hpwOS)/(\d+)\.(\d+)(?:\.(\d+))?'
501
+ os_replacement: 'webOS'
502
+
503
+ ##########
504
+ # Generic patterns
505
+ # since the majority of os cases are very specific, these go last
506
+ ##########
507
+ # first.second.third.fourth bits
508
+ - regex: '(SUSE|Fedora|Red Hat|PCLinuxOS)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
509
+
510
+ # first.second.third bits
511
+ - regex: '(SUSE|Fedora|Red Hat|Puppy|PCLinuxOS|CentOS)/(\d+)\.(\d+)\.(\d+)'
512
+
513
+ # first.second bits
514
+ - regex: '(Ubuntu|Kindle|Bada|Lubuntu|BackTrack|Red Hat|Slackware)/(\d+)\.(\d+)'
515
+ - regex: '(PlayStation Vita) (\d+)\.(\d+)'
516
+
517
+ # just os
518
+ - regex: '(Windows|OpenBSD|FreeBSD|NetBSD|Ubuntu|Kubuntu|Android|Arch Linux|CentOS|WeTab|Slackware)'
519
+ - regex: '(Linux|BSD)'
520
+
521
+ device_parsers:
522
+ ##########
523
+ # incomplete!
524
+ # multiple replacement placeholds i.e. ($1) ($2) help solve problem of single device with multiple representations in ua
525
+ # e.g. HTC Dream S should parse to the same device as HTC_DreamS
526
+ ##########
527
+
528
+ ##########
529
+ # incomplete!
530
+ # HTC
531
+ # http://en.wikipedia.org/wiki/List_of_HTC_phones
532
+ # this is quickly getting unwieldy
533
+ ##########
534
+ # example: Mozilla/5.0 (Linux; U; Android 2.3.2; fr-fr; HTC HD2 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
535
+ - regex: 'HTC ([A-Z][a-z0-9]+) Build'
536
+ device_replacement: 'HTC $1'
537
+ # example: Mozilla/5.0 (Linux; U; Android 2.1; es-es; HTC Legend 1.23.161.1 Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17,gzip
538
+ - regex: 'HTC ([A-Z][a-z0-9 ]+) \d+\.\d+\.\d+\.\d+'
539
+ device_replacement: 'HTC $1'
540
+ # example: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; HTC_Touch_Diamond2_T5353; Windows Phone 6.5.3.5)
541
+ - regex: 'HTC_Touch_([A-Za-z0-9]+)'
542
+ device_replacement: 'HTC Touch ($1)'
543
+ # should come after HTC_Touch
544
+ - regex: 'USCCHTC(\d+)'
545
+ device_replacement: 'HTC $1 (US Cellular)'
546
+ - regex: 'Sprint APA(9292)'
547
+ device_replacement: 'HTC $1 (Sprint)'
548
+ - regex: 'HTC ([A-Za-z0-9]+ [A-Z])'
549
+ device_replacement: 'HTC $1'
550
+ - regex: 'HTC-([A-Za-z0-9]+)'
551
+ device_replacement: 'HTC $1'
552
+ - regex: 'HTC_([A-Za-z0-9]+)'
553
+ device_replacement: 'HTC $1'
554
+ - regex: 'HTC ([A-Za-z0-9]+)'
555
+ device_replacement: 'HTC $1'
556
+ - regex: '(ADR[A-Za-z0-9]+)'
557
+ device_replacement: 'HTC $1'
558
+ - regex: '(HTC)'
559
+
560
+ # Samsung
561
+ - regex: '(SamsungSGHi560)'
562
+ device_replacement: 'Samsung SGHi560'
563
+
564
+ #########
565
+ # Ericsson - must come before nokia since they also use symbian
566
+ #########
567
+ - regex: 'SonyEricsson([A-Za-z0-9]+)/'
568
+ device_replacement: 'Ericsson $1'
569
+
570
+ #########
571
+ # Android General Device Matching (far from perfect)
572
+ #########
573
+ - regex: 'Android[\- ][\d]+\.[\d]+\; [A-Za-z]{2}\-[A-Za-z]{2}\; WOWMobile (.+) Build'
574
+ - regex: 'Android[\- ][\d]+\.[\d]+\.[\d]+; [A-Za-z]{2}\-[A-Za-z]{2}\; (.+) Build'
575
+ - regex: 'Android[\- ][\d]+\.[\d]+\-update1\; [A-Za-z]{2}\-[A-Za-z]{2}\; (.+) Build'
576
+ - regex: 'Android[\- ][\d]+\.[\d]+\; [A-Za-z]{2}\-[A-Za-z]{2}\; (.+) Build'
577
+ - regex: 'Android[\- ][\d]+\.[\d]+\.[\d]+; (.+) Build'
578
+
579
+ ##########
580
+ # NOKIA
581
+ # nokia NokiaN8-00 comes before iphone. sometimes spoofs iphone
582
+ ##########
583
+ - regex: 'NokiaN([0-9]+)'
584
+ device_replacement: 'Nokia N$1'
585
+ - regex: 'Nokia([A-Za-z0-9\v-]+)'
586
+ device_replacement: 'Nokia $1'
587
+ - regex: 'NOKIA ([A-Za-z0-9\-]+)'
588
+ device_replacement: 'Nokia $1'
589
+ - regex: 'Nokia ([A-Za-z0-9\-]+)'
590
+ device_replacement: 'Nokia $1'
591
+ - regex: 'Lumia ([A-Za-z0-9\-]+)'
592
+ device_replacement: 'Lumia $1'
593
+ - regex: 'Symbian'
594
+ device_replacement: 'Nokia'
595
+
596
+ ##########
597
+ # Blackberry
598
+ # http://www.useragentstring.com/pages/BlackBerry/
599
+ ##########
600
+ - regex: '(PlayBook).+RIM Tablet OS'
601
+ device_replacement: 'Blackberry Playbook'
602
+ - regex: '(Black[Bb]erry [0-9]+);'
603
+ - regex: 'Black[Bb]erry([0-9]+)'
604
+ device_replacement: 'BlackBerry $1'
605
+
606
+ ##########
607
+ # PALM / HP
608
+ ##########
609
+ # some palm devices must come before iphone. sometimes spoofs iphone in ua
610
+ - regex: '(Pre)/(\d+)\.(\d+)'
611
+ device_replacement: 'Palm Pre'
612
+ - regex: '(Pixi)/(\d+)\.(\d+)'
613
+ device_replacement: 'Palm Pixi'
614
+ - regex: '(Touchpad)/(\d+)\.(\d+)'
615
+ device_replacement: 'HP Touchpad'
616
+ - regex: 'HPiPAQ([A-Za-z0-9]+)/(\d+).(\d+)'
617
+ device_replacement: 'HP iPAQ $1'
618
+ - regex: 'Palm([A-Za-z0-9]+)'
619
+ device_replacement: 'Palm $1'
620
+ - regex: 'Treo([A-Za-z0-9]+)'
621
+ device_replacement: 'Palm Treo $1'
622
+ - regex: 'webOS.*(P160UNA)/(\d+).(\d+)'
623
+ device_replacement: 'HP Veer'
624
+
625
+ ##########
626
+ # PlayStation
627
+ ##########
628
+ - regex: '(PlayStation Portable)'
629
+ - regex: '(PlayStation Vita)'
630
+
631
+ ##########
632
+ # incomplete!
633
+ # Kindle
634
+ ##########
635
+ - regex: '(Kindle Fire)'
636
+ - regex: '(Kindle)'
637
+ - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+))?'
638
+ device_replacement: 'Kindle Fire'
639
+
640
+ ##########
641
+ # AppleTV
642
+ # No built in browser that I can tell
643
+ # Stack Overflow indicated iTunes-AppleTV/4.1 as a known UA for app available and I'm seeing it in live traffic
644
+ ##########
645
+ - regex: '(AppleTV)'
646
+ device_replacement: 'AppleTV'
647
+
648
+ ##########
649
+ # complete but probably catches spoofs
650
+ # iSTUFF
651
+ ##########
652
+ # ipad and ipod must be parsed before iphone
653
+ # cannot determine specific device type from ua string. (3g, 3gs, 4, etc)
654
+ - regex: '(iPad) Simulator;'
655
+ - regex: '(iPad);'
656
+ - regex: '(iPod);'
657
+ - regex: '(iPhone) Simulator;'
658
+ - regex: '(iPhone);'
659
+
660
+ ##########
661
+ # Acer
662
+ ##########
663
+ - regex: 'acer_([A-Za-z0-9]+)_'
664
+ device_replacement: 'Acer $1'
665
+ - regex: 'acer_([A-Za-z0-9]+)_'
666
+ device_replacement: 'Acer $1'
667
+
668
+ ##########
669
+ # Amoi
670
+ ##########
671
+ - regex: 'Amoi\-([A-Za-z0-9]+)'
672
+ device_replacement: 'Amoi $1'
673
+ - regex: 'AMOI\-([A-Za-z0-9]+)'
674
+ device_replacement: 'Amoi $1'
675
+
676
+ ##########
677
+ # Amoi
678
+ ##########
679
+ - regex: 'Asus\-([A-Za-z0-9]+)'
680
+ device_replacement: 'Asus $1'
681
+ - regex: 'ASUS\-([A-Za-z0-9]+)'
682
+ device_replacement: 'Asus $1'
683
+
684
+ ##########
685
+ # Bird
686
+ ##########
687
+ - regex: 'BIRD\-([A-Za-z0-9]+)'
688
+ device_replacement: 'Bird $1'
689
+ - regex: 'BIRD\.([A-Za-z0-9]+)'
690
+ device_replacement: 'Bird $1'
691
+ - regex: 'BIRD ([A-Za-z0-9]+)'
692
+ device_replacement: 'Bird $1'
693
+
694
+ ##########
695
+ # Dell
696
+ ##########
697
+ - regex: 'Dell ([A-Za-z0-9]+)'
698
+ device_replacement: 'Dell $1'
699
+
700
+ ##########
701
+ # DoCoMo
702
+ ##########
703
+ - regex: 'DoCoMo/2\.0 ([A-Za-z0-9]+)'
704
+ device_replacement: 'DoCoMo $1'
705
+ - regex: '([A-Za-z0-9]+)\_W\;FOMA'
706
+ device_replacement: 'DoCoMo $1'
707
+ - regex: '([A-Za-z0-9]+)\;FOMA'
708
+ device_replacement: 'DoCoMo $1'
709
+
710
+ ##########
711
+ # Huawei Vodafone
712
+ ##########
713
+ - regex: 'vodafone([A-Za-z0-9]+)'
714
+ device_replacement: 'Huawei Vodafone $1'
715
+
716
+ ##########
717
+ # i-mate
718
+ ##########
719
+ - regex: 'i\-mate ([A-Za-z0-9]+)'
720
+ device_replacement: 'i-mate $1'
721
+
722
+ ##########
723
+ # kyocera
724
+ ##########
725
+ - regex: 'Kyocera\-([A-Za-z0-9]+)'
726
+ device_replacement: 'Kyocera $1'
727
+ - regex: 'KWC\-([A-Za-z0-9]+)'
728
+ device_replacement: 'Kyocera $1'
729
+
730
+ ##########
731
+ # lenovo
732
+ ##########
733
+ - regex: 'Lenovo\-([A-Za-z0-9]+)'
734
+ device_replacement: 'Lenovo $1'
735
+ - regex: 'Lenovo\_([A-Za-z0-9]+)'
736
+ device_replacement: 'Lenovo $1'
737
+
738
+ ##########
739
+ # lg
740
+ ##########
741
+ - regex: 'LG/([A-Za-z0-9]+)'
742
+ device_replacement: 'LG $1'
743
+ - regex: 'LG-LG([A-Za-z0-9]+)'
744
+ device_replacement: 'LG $1'
745
+ - regex: 'LGE-LG([A-Za-z0-9]+)'
746
+ device_replacement: 'LG $1'
747
+ - regex: 'LGE VX([A-Za-z0-9]+)'
748
+ device_replacement: 'LG $1'
749
+ - regex: 'LG ([A-Za-z0-9]+)'
750
+ device_replacement: 'LG $1'
751
+ - regex: 'LGE LG\-AX([A-Za-z0-9]+)'
752
+ device_replacement: 'LG $1'
753
+ - regex: 'LG\-([A-Za-z0-9]+)'
754
+ device_replacement: 'LG $1'
755
+ - regex: 'LGE\-([A-Za-z0-9]+)'
756
+ device_replacement: 'LG $1'
757
+ - regex: 'LG([A-Za-z0-9]+)'
758
+ device_replacement: 'LG $1'
759
+
760
+ ##########
761
+ # kin
762
+ ##########
763
+ - regex: '(KIN)\.One (\d+)\.(\d+)'
764
+ device_replacement: 'Microsoft $1'
765
+ - regex: '(KIN)\.Two (\d+)\.(\d+)'
766
+ device_replacement: 'Microsoft $1'
767
+
768
+ ##########
769
+ # motorola
770
+ ##########
771
+ - regex: '(Motorola)\-([A-Za-z0-9]+)'
772
+ - regex: 'MOTO\-([A-Za-z0-9]+)'
773
+ device_replacement: 'Motorola $1'
774
+ - regex: 'MOT\-([A-Za-z0-9]+)'
775
+ device_replacement: 'Motorola $1'
776
+
777
+ ##########
778
+ # philips
779
+ ##########
780
+ - regex: 'Philips([A-Za-z0-9]+)'
781
+ device_replacement: 'Philips $1'
782
+ - regex: 'Philips ([A-Za-z0-9]+)'
783
+ device_replacement: 'Philips $1'
784
+
785
+ ##########
786
+ # Samsung
787
+ ##########
788
+ - regex: 'SAMSUNG-([A-Za-z0-9\-]+)'
789
+ device_replacement: 'Samsung $1'
790
+ - regex: 'SAMSUNG\; ([A-Za-z0-9\-]+)'
791
+ device_replacement: 'Samsung $1'
792
+
793
+ ##########
794
+ # Softbank
795
+ ##########
796
+ - regex: 'Softbank/1\.0/([A-Za-z0-9]+)'
797
+ device_replacement: 'Softbank $1'
798
+ - regex: 'Softbank/2\.0/([A-Za-z0-9]+)'
799
+ device_replacement: 'Softbank $1'
800
+
801
+ ##########
802
+ # Sony
803
+ ##########
804
+ - regex: '(PlayStation3 PPC)'
805
+ device_replacement: 'Playstation 3'
806
+
807
+ ##########
808
+ # Generic Smart Phone
809
+ ##########
810
+ - regex: '(hiptop|avantgo|plucker|xiino|blazer|elaine|up.browser|up.link|mmp|smartphone|midp|wap|vodafone|o2|pocket|mobile|pda)'
811
+ device_replacement: "Generic Smartphone"
812
+
813
+ ##########
814
+ # Generic Feature Phone
815
+ ##########
816
+ - regex: '^(1207|3gso|4thp|501i|502i|503i|504i|505i|506i|6310|6590|770s|802s|a wa|acer|acs\-|airn|alav|asus|attw|au\-m|aur |aus |abac|acoo|aiko|alco|alca|amoi|anex|anny|anyw|aptu|arch|argo|bell|bird|bw\-n|bw\-u|beck|benq|bilb|blac|c55/|cdm\-|chtm|capi|comp|cond|craw|dall|dbte|dc\-s|dica|ds\-d|ds12|dait|devi|dmob|doco|dopo|el49|erk0|esl8|ez40|ez60|ez70|ezos|ezze|elai|emul|eric|ezwa|fake|fly\-|fly\_|g\-mo|g1 u|g560|gf\-5|grun|gene|go.w|good|grad|hcit|hd\-m|hd\-p|hd\-t|hei\-|hp i|hpip|hs\-c|htc |htc\-|htca|htcg)'
817
+ device_replacement: 'Generic Feature Phone'
818
+ - regex: '^(htcp|htcs|htct|htc\_|haie|hita|huaw|hutc|i\-20|i\-go|i\-ma|i230|iac|iac\-|iac/|ig01|im1k|inno|iris|jata|java|kddi|kgt|kgt/|kpt |kwc\-|klon|lexi|lg g|lg\-a|lg\-b|lg\-c|lg\-d|lg\-f|lg\-g|lg\-k|lg\-l|lg\-m|lg\-o|lg\-p|lg\-s|lg\-t|lg\-u|lg\-w|lg/k|lg/l|lg/u|lg50|lg54|lge\-|lge/|lynx|leno|m1\-w|m3ga|m50/|maui|mc01|mc21|mcca|medi|meri|mio8|mioa|mo01|mo02|mode|modo|mot |mot\-|mt50|mtp1|mtv |mate|maxo|merc|mits|mobi|motv|mozz|n100|n101|n102|n202|n203|n300|n302|n500|n502|n505|n700|n701|n710|nec\-|nem\-|newg|neon)'
819
+ device_replacement: 'Generic Feature Phone'
820
+ - regex: '^(netf|noki|nzph|o2 x|o2\-x|opwv|owg1|opti|oran|ot\-s|p800|pand|pg\-1|pg\-2|pg\-3|pg\-6|pg\-8|pg\-c|pg13|phil|pn\-2|pt\-g|palm|pana|pire|pock|pose|psio|qa\-a|qc\-2|qc\-3|qc\-5|qc\-7|qc07|qc12|qc21|qc32|qc60|qci\-|qwap|qtek|r380|r600|raks|rim9|rove|s55/|sage|sams|sc01|sch\-|scp\-|sdk/|se47|sec\-|sec0|sec1|semc|sgh\-|shar|sie\-|sk\-0|sl45|slid|smb3|smt5|sp01|sph\-|spv |spv\-|sy01|samm|sany|sava|scoo|send|siem|smar|smit|soft|sony|t\-mo|t218|t250|t600|t610|t618|tcl\-|tdg\-|telm|tim\-|ts70|tsm\-|tsm3|tsm5|tx\-9|tagt)'
821
+ device_replacement: 'Generic Feature Phone'
822
+ - regex: '^(talk|teli|topl|tosh|up.b|upg1|utst|v400|v750|veri|vk\-v|vk40|vk50|vk52|vk53|vm40|vx98|virg|vite|voda|vulc|w3c |w3c\-|wapj|wapp|wapu|wapm|wig |wapi|wapr|wapv|wapy|wapa|waps|wapt|winc|winw|wonu|x700|xda2|xdag|yas\-|your|zte\-|zeto|aste|audi|avan|blaz|brew|brvw|bumb|ccwa|cell|cldc|cmd\-|dang|eml2|fetc|hipt|http|ibro|idea|ikom|ipaq|jbro|jemu|jigs|keji|kyoc|kyok|libw|m\-cr|midp|mmef|moto|mwbp|mywa|newt|nok6|o2im|pant|pdxg|play|pluc|port|prox|rozo|sama|seri|smal|symb|treo|upsi|vx52|vx53|vx60|vx61|vx70|vx80|vx81|vx83|vx85|wap\-|webc|whit|wmlb|xda\-|xda\_)'
823
+ device_replacement: 'Generic Feature Phone'
824
+
825
+ ##########
826
+ # Spiders (this is hack...)
827
+ ##########
828
+ - regex: '(bot|borg|google(^tv)|yahoo|slurp|msnbot|msrbot|openbot|archiver|netresearch|lycos|scooter|altavista|teoma|gigabot|baiduspider|blitzbot|oegp|charlotte|furlbot|http%20client|polybot|htdig|ichiro|mogimogi|larbin|pompos|scrubby|searchsight|seekbot|semanticdiscovery|silk|snappy|speedy|spider|voila|vortex|voyager|zao|zeal|fast\-webcrawler|converacrawler|dataparksearch|findlinks)'
829
+ device_replacement: 'Spider'
830
+
831
+
832
+ mobile_user_agent_families:
833
+ - 'Firefox Mobile'
834
+ - 'Opera Mobile'
835
+ - 'Opera Mini'
836
+ - 'Mobile Safari'
837
+ - 'webOS'
838
+ - 'IE Mobile'
839
+ - 'Playstation Portable'
840
+ - 'Nokia'
841
+ - 'Blackberry'
842
+ - 'Palm'
843
+ - 'Silk'
844
+ - 'Android'
845
+ - 'Maemo'
846
+ - 'Obigo'
847
+ - 'Netfront'
848
+ - 'AvantGo'
849
+ - 'Teleca'
850
+ - 'SEMC-Browser'
851
+ - 'Bolt'
852
+ - 'Iris'
853
+ - 'UP.Browser'
854
+ - 'Symphony'
855
+ - 'Minimo'
856
+ - 'Bunjaloo'
857
+ - 'Jasmine'
858
+ - 'Dolfin'
859
+ - 'Polaris'
860
+ - 'BREW'
861
+ - 'Chrome Mobile'
862
+ - 'UC Browser'
863
+ - 'Tizen Browser'
864
+
865
+ # Some select mobile OSs report a desktop browser.
866
+ # make sure we note they're mobile
867
+ mobile_os_families:
868
+ - 'Windows Phone 6.5'
869
+ - 'Windows CE'
870
+ - 'Symbian OS'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_agent_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000 Z
12
+ date: 2012-11-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple, comprehensive Ruby gem for parsing user agent strings with
15
15
  the help of BrowserScope's UA database
@@ -18,11 +18,14 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - MIT-LICENSE
22
+ - Readme.md
21
23
  - lib/user_agent_parser.rb
22
24
  - lib/user_agent_parser/operating_system.rb
23
25
  - lib/user_agent_parser/parser.rb
24
26
  - lib/user_agent_parser/user_agent.rb
25
27
  - lib/user_agent_parser/version.rb
28
+ - vendor/ua-parser/regexes.yaml
26
29
  homepage: http://github.com/toolmantim/user_agent_parser
27
30
  licenses:
28
31
  - MIT
@@ -42,9 +45,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
45
  - - ! '>='
43
46
  - !ruby/object:Gem::Version
44
47
  version: '0'
45
- segments:
46
- - 0
47
- hash: 2720701220446018537
48
48
  requirements: []
49
49
  rubyforge_project:
50
50
  rubygems_version: 1.8.23