Comparing version 0.4.0 to 0.4.1
@@ -35,3 +35,3 @@ var KEY_LABEL = exports.KEY_LABEL = 'label', | ||
var DATASET = {}; | ||
// GENERATED from dataset.yaml at Sun Apr 6 15:41:22 JST 2014 by tagomoris | ||
// GENERATED from dataset.yaml at Fri Apr 25 13:03:53 JST 2014 by tagomoris | ||
var obj; | ||
@@ -107,2 +107,5 @@ obj = {label:'MSIE', name:'Internet Explorer', type:'browser'}; | ||
DATASET[obj.label] = obj; | ||
obj = {label:'ChromeOS', name:'ChromeOS', type:'os'}; | ||
obj['category'] = 'pc'; | ||
DATASET[obj.label] = obj; | ||
obj = {label:'Android', name:'Android', type:'os'}; | ||
@@ -109,0 +112,0 @@ obj['category'] = 'smartphone'; |
@@ -66,3 +66,3 @@ /* HEADER BEGIN */ | ||
else if (ua.indexOf('iPad;') >= 0) data = dataset.get('iPad'); | ||
else if (ua.indexOf('iPod;') >= 0) data = dataset.get('iPod'); | ||
else if (ua.indexOf('iPod') >= 0) data = dataset.get('iPod'); | ||
} | ||
@@ -98,3 +98,4 @@ updateCategory(result, data[dataset.KEY_CATEGORY]); | ||
// http://lawrencemandel.com/2012/07/27/decision-made-firefox-os-user-agent-string/ | ||
if (/^Mozilla\/[.0-9]+ \(Mobile;(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/.exec(ua)) { | ||
// https://github.com/woothee/woothee/issues/2 | ||
if (/^Mozilla\/[.0-9]+ \((Mobile|Tablet);(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/.exec(ua)) { | ||
data = dataset.get('FirefoxOS'); | ||
@@ -177,2 +178,3 @@ } | ||
else if (ua.indexOf('X11; FreeBSD ') >= 0) data = dataset.get('BSD'); | ||
else if (ua.indexOf('X11; CrOS ') >= 0) data = dataset.get('ChromeOS'); | ||
@@ -179,0 +181,0 @@ if (data) { |
{ | ||
"name": "woothee", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "User-Agent string parser (js implementation)", | ||
@@ -5,0 +5,0 @@ "main": "./release/woothee", |
@@ -5,6 +5,6 @@ (function (){ | ||
// GENERATED from dataset.yaml at Sun Apr 6 15:41:23 JST 2014 by tagomoris | ||
// GENERATED from dataset.yaml at Fri Apr 25 13:06:56 JST 2014 by tagomoris | ||
// Snapshot from package.json | ||
var package_info = {"name":"woothee","version":"0.4.0","description":"User-Agent string parser (js implementation)","main":"./release/woothee","devDependencies":{"mocha":">= 1.7.0","chai":">= 1.3.0","js-yaml":">= 1.0.3","should":"~1.2.2"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"https://github.com/woothee/woothee-js"},"author":"tagomoris","license":"Apache v2"}; | ||
var package_info = {"name":"woothee","version":"0.4.1","description":"User-Agent string parser (js implementation)","main":"./release/woothee","devDependencies":{"mocha":">= 1.7.0","chai":">= 1.3.0","js-yaml":">= 1.0.3","should":"~1.2.2"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"https://github.com/woothee/woothee-js"},"author":"tagomoris","license":"Apache v2"}; | ||
@@ -43,3 +43,3 @@ var dataset = {}; | ||
var DATASET = {}; | ||
// GENERATED from dataset.yaml at Sun Apr 6 15:41:22 JST 2014 by tagomoris | ||
// GENERATED from dataset.yaml at Fri Apr 25 13:06:56 JST 2014 by tagomoris | ||
var obj; | ||
@@ -115,2 +115,5 @@ obj = {label:'MSIE', name:'Internet Explorer', type:'browser'}; | ||
DATASET[obj.label] = obj; | ||
obj = {label:'ChromeOS', name:'ChromeOS', type:'os'}; | ||
obj['category'] = 'pc'; | ||
DATASET[obj.label] = obj; | ||
obj = {label:'Android', name:'Android', type:'os'}; | ||
@@ -543,3 +546,3 @@ obj['category'] = 'smartphone'; | ||
else if (ua.indexOf('iPad;') >= 0) data = dataset.get('iPad'); | ||
else if (ua.indexOf('iPod;') >= 0) data = dataset.get('iPod'); | ||
else if (ua.indexOf('iPod') >= 0) data = dataset.get('iPod'); | ||
} | ||
@@ -571,3 +574,4 @@ updateCategory(result, data[dataset.KEY_CATEGORY]); | ||
// http://lawrencemandel.com/2012/07/27/decision-made-firefox-os-user-agent-string/ | ||
if (/^Mozilla\/[.0-9]+ \(Mobile;(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/.exec(ua)) { | ||
// https://github.com/woothee/woothee/issues/2 | ||
if (/^Mozilla\/[.0-9]+ \((Mobile|Tablet);(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/.exec(ua)) { | ||
data = dataset.get('FirefoxOS'); | ||
@@ -644,2 +648,3 @@ } | ||
else if (ua.indexOf('X11; FreeBSD ') >= 0) data = dataset.get('BSD'); | ||
else if (ua.indexOf('X11; CrOS ') >= 0) data = dataset.get('ChromeOS'); | ||
if (data) { | ||
@@ -646,0 +651,0 @@ updateCategory(result, data[dataset.KEY_CATEGORY]); |
@@ -19,6 +19,7 @@ # Project Woothee | ||
* PHP | ||
* Go | ||
## Versions | ||
* v0.3.8 (Latest of v0.3.x) | ||
* v0.4.0 (Latest of 0.4.x) | ||
@@ -39,2 +40,4 @@ ## Implementations | ||
* https://github.com/woothee/woothee-php | ||
* Golang | ||
* https://github.com/woothee/woothee-go | ||
@@ -70,3 +73,3 @@ | ||
-- count visits of bots | ||
SELECT parsed_agent('name') AS botname, COUNT(*) AS cnt | ||
SELECT parsed_agent['name'] AS botname, COUNT(*) AS cnt | ||
FROM ( | ||
@@ -77,4 +80,4 @@ SELECT parse_agent(user_agent) AS parsed_agent | ||
) x | ||
WHERE parsed_agent('category') = 'crawler' | ||
GROUP BY parsed_agent('name') | ||
WHERE parsed_agent['category'] = 'crawler' | ||
GROUP BY parsed_agent['name'] | ||
ORDER BY cnt DESC LIMIT 1000; | ||
@@ -81,0 +84,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147129
50
2577