Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgiehl <stefan@piwik.org>2014-02-13 17:37:36 +0400
committersgiehl <stefan@piwik.org>2014-02-13 17:37:36 +0400
commit13f776e0ff0df6fcb02420811118e3e4cb1b7a49 (patch)
tree3b98c33dbab63b5c14017fd7df7d0d5b5aac816d /plugins/DevicesDetection
parent2e3b70c4900fd115de7a6173ce466074001410d4 (diff)
added detection for some android powered cameras and gaming console
Diffstat (limited to 'plugins/DevicesDetection')
-rw-r--r--plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php5
-rw-r--r--plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml19
-rw-r--r--plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml2
-rw-r--r--plugins/DevicesDetection/functions.php6
-rw-r--r--plugins/DevicesDetection/images/screens/camera.pngbin0 -> 644 bytes
-rw-r--r--plugins/DevicesDetection/lang/en.json1
6 files changed, 27 insertions, 6 deletions
diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
index 0e51996f3d..fa5ad4ac60 100644
--- a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
+++ b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
@@ -19,7 +19,8 @@ class UserAgentParserEnhanced
'console', // 4
'tv', // 5
'car browser', // 6
- 'smart display' // 7
+ 'smart display', // 7
+ 'camera' // 8
);
public static $deviceBrands = array(
@@ -106,12 +107,14 @@ class UserAgentParserEnhanced
'NG' => 'NGM',
'NI' => 'Nintendo',
'NK' => 'Nokia',
+ 'NN' => 'Nikon',
'NW' => 'Newgen',
'NX' => 'Nexian',
'OD' => 'Onda',
'OP' => 'OPPO',
'OR' => 'Orange',
'OT' => 'O2',
+ 'OU' => 'OUYA',
'PA' => 'Panasonic',
'PE' => 'PEAQ',
'PH' => 'Philips',
diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml
index e8e987462e..14ae68db3d 100644
--- a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml
+++ b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml
@@ -761,7 +761,13 @@ Nexian:
model: '$1'
- regex: 'S?Nexian-([a-z0-9]+)'
model: '$1'
-
+
+#Nikon
+Nikon:
+ regex: 'Coolpix S800c'
+ device: 'camera'
+ model: 'Coolpix S800c'
+
# o2
O2:
regex: 'Xda|O2[ \-]|COCOON'
@@ -798,6 +804,12 @@ Orange:
device: 'smartphone'
model: 'SPV $1'
+#OUYA
+OUYA:
+ regex: 'OUYA'
+ device: 'console'
+ model: 'OUYA'
+
# panasonic
Panasonic:
regex: 'Panasonic'
@@ -851,7 +863,7 @@ Siemens:
# Samsung
Samsung:
- regex: 'SAMSUNG|S(?:CH|GH|PH|EC|AM|HV|HW)-|SMART-TV|GT-|Galaxy|(?:portalmmm|o2imode)/2\.0 [SZ]|sam[rua]'
+ regex: 'SAMSUNG|S(?:CH|GH|PH|EC|AM|HV|HW)-|SMART-TV|GT-|Galaxy|(?:portalmmm|o2imode)/2\.0 [SZ]|sam[rua]|EK-GC[0-9]{3}'
device: 'smartphone'
models:
- regex: '(GT-(P|N8|N5)[0-9]+[a-z]?)'
@@ -867,6 +879,9 @@ Samsung:
model: '$1'
- regex: '((?:SCH|SGH|SPH|SHV|SHW|GT)-[a-z0-9]+)'
model: '$1'
+ - regex: 'EK-GC([0-9]{3})'
+ device: 'camera'
+ model: 'Galaxy Camera $1'
- regex: 'SEC-([a-z0-9]+)'
model: '$1'
- regex: 'SAM-([a-z0-9]+)'
diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml
index a42f74c941..5c950d50af 100644
--- a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml
+++ b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml
@@ -47,7 +47,7 @@
##########
# Android
##########
-- regex: 'Android[ /](\d+\.\d+)'
+- regex: 'Android[ /](?:[a-z]+ )?(\d+\.\d+)'
name: 'Android'
version: '$1'
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index 37b5ec3ea2..21cfa8ae33 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -107,7 +107,8 @@ function getDeviceTypeLabel($label)
'console' => 'DevicesDetection_Console',
'tv' => 'DevicesDetection_TV',
'car browser' => 'DevicesDetection_CarBbrowser',
- 'smart display' => 'DevicesDetection_SmartDisplay'
+ 'smart display' => 'DevicesDetection_SmartDisplay',
+ 'camera' => 'DevicesDetection_Camera'
);
if (isset(UserAgentParserEnhanced::$deviceTypes[$label]) && isset($translations[UserAgentParserEnhanced::$deviceTypes[$label]])) {
return Piwik::translate($translations[UserAgentParserEnhanced::$deviceTypes[$label]]);
@@ -133,7 +134,8 @@ function getDeviceTypeLogo($label)
"tv" => "tv.png",
"feature phone" => "mobile.gif",
"console" => "console.gif",
- "car browser" => "carbrowser.png");
+ "car browser" => "carbrowser.png",
+ "camera" => "camera.png");
if (!array_key_exists($label, $deviceTypeLogos) || $label == "Unknown") {
$label = 'unknown.gif';
diff --git a/plugins/DevicesDetection/images/screens/camera.png b/plugins/DevicesDetection/images/screens/camera.png
new file mode 100644
index 0000000000..bd9deed867
--- /dev/null
+++ b/plugins/DevicesDetection/images/screens/camera.png
Binary files differ
diff --git a/plugins/DevicesDetection/lang/en.json b/plugins/DevicesDetection/lang/en.json
index d364dfb21c..c10124efef 100644
--- a/plugins/DevicesDetection/lang/en.json
+++ b/plugins/DevicesDetection/lang/en.json
@@ -19,6 +19,7 @@
"UserAgent": "User-Agent",
"Smartphone": "Smartphone",
"CarBrowser": "Car browser",
+ "Camera": "Camera",
"Tablet": "Tablet",
"SmartDisplay": "Smart display",
"FeaturePhone": "Feature phone",