Skip to content

Commit

Permalink
Adds detection for Wear OS, Odd Browser, Mobvoi brand and various bots (
Browse files Browse the repository at this point in the history
matomo-org#7447)

* Adds detection for Research Scan bot
* Adds detection for Wear OS
* Adds detection for Odd Browser
* Fix fixture for Odd Browser
* Adds detection for Mobvoi brand and TicWatch Pro S, TicWatch S2
* Adds detection for Mobvoi TicWatch C2, TicWatch C2+
* Adds detection for Mobvoi TicWatch S
* Adds detection for Dogecoin Core
* Adds detection for Scraping Robot
* Improves detection for Googlebot
* Adds detection for Yahoo! Japan WSC
* Fix identations
* Improve regex for Googlebot
* Improve regex for Wear OS
  • Loading branch information
liviuconcioiu authored Aug 7, 2023
1 parent 74f6c4f commit a9f29e5
Show file tree
Hide file tree
Showing 13 changed files with 259 additions and 51 deletions.
4 changes: 3 additions & 1 deletion Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ class Browser extends AbstractClientParser
'WR' => 'NextWord Browser',
'NT' => 'NTENT Browser',
'OC' => 'Oculus Browser',
'O6' => 'Odd Browser',
'O1' => 'Opera Mini iOS',
'OB' => 'Obigo',
'O2' => 'Odin',
Expand Down Expand Up @@ -588,6 +589,7 @@ class Browser extends AbstractClientParser
'HO', 'A5', 'X1', '18', 'B5', 'B6', 'TC', 'A6', '2X',
'F4', 'YG', 'WR', 'NA', 'DM', '1M', 'A7', 'XN', 'XT',
'XB', 'W1', 'HT', 'B8', 'F5', 'B9', 'WA', 'T0', 'HC',
'O6',
],
'Firefox' => [
'AX', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
Expand Down Expand Up @@ -625,7 +627,7 @@ class Browser extends AbstractClientParser
'O4', 'XO', 'U0', 'B0', 'VA', 'X0', 'A5', 'X1', '18',
'B5', 'B6', 'TC', 'A6', '2X', 'F4', 'YG', 'WR', 'NA',
'DM', '1M', 'A7', 'XN', 'XT', 'XB', 'W1', 'HT', 'B7',
'B9', 'T0', 'I8',
'B9', 'T0', 'I8', 'O6',
];

/**
Expand Down
1 change: 1 addition & 0 deletions Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'6W' => 'MobiWire',
'9M' => 'Mobo',
'MOB' => 'Mobell',
'MVO' => 'Mobvoi',
'M4' => 'Modecom',
'MF' => 'Mofut',
'MR' => 'Motorola',
Expand Down
3 changes: 2 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class OperatingSystem extends AbstractParser
'TOS' => 'TmaxOS',
'UBT' => 'Ubuntu',
'WAS' => 'watchOS',
'WER' => 'Wear OS',
'WTV' => 'WebTV',
'WHS' => 'Whale OS',
'WIN' => 'Windows',
Expand All @@ -182,7 +183,7 @@ class OperatingSystem extends AbstractParser
protected static $osFamilies = [
'Android' => [
'AND', 'CYN', 'FIR', 'REM', 'RZD', 'MLD', 'MCD', 'YNS', 'GRI', 'HAR',
'ADR', 'CLR', 'BOS', 'REV', 'LEN', 'SIR', 'RRS',
'ADR', 'CLR', 'BOS', 'REV', 'LEN', 'SIR', 'RRS', 'WER',
],
'AmigaOS' => ['AMG', 'MOR'],
'BlackBerry' => ['BLB', 'QNX'],
Expand Down
9 changes: 9 additions & 0 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7353,3 +7353,12 @@
engine: Blink
engine_version: ""
family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 9; TicWatch Pro S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Odd/47.2.1.1 Mobile Safari/537.36
client:
type: browser
name: Odd Browser
version: 47.2.1.1
engine: Blink
engine_version: 77.0.3865.92
family: Chrome
6 changes: 6 additions & 0 deletions Tests/Parser/Client/fixtures/mobile_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,12 @@
type: mobile app
name: Bitcoin Core
version: 22.0.0
-
user_agent: /Shibetoshi:1.14.6/
client:
type: mobile app
name: Dogecoin Core
version: 1.14.6
-
user_agent: Mozilla/5.0 (Linux; Android 11; Build/RKQ1.201217.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.156 Mobile Safari/537.36 WpsMoffice/13.23.1/armeabi-v7a/1310
client:
Expand Down
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3878,3 +3878,11 @@
version: "7.7"
platform: ""
family: BeOS
-
user_agent: Mozilla/5.0 (Linux; Android 9; TicWatch Pro S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Odd/47.2.1.1 Mobile Safari/537.36
os:
name: Wear OS
short_name: WER
version:
platform:
family: Android
38 changes: 37 additions & 1 deletion Tests/fixtures/bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,16 @@
bot:
name: Yahoo! Japan BRW
category: Crawler
url: https://www.yahoo-help.jp/app/answers/detail/p/595/a_id/42716/~/ウェブページにアクセスするシステムのユーザーエージェントについて
url: https://support.yahoo-net.jp/PccSearch/s/article/H000007955
producer:
name: Yahoo! Japan Corp.
url: https://www.yahoo.co.jp/
-
user_agent: Mozilla/5.0 (compatible; Y!J-WSC/1.0; +https://yahoo.jp/3BSZgF)
bot:
name: Yahoo! Japan WSC
category: Crawler
url: https://support.yahoo-net.jp/PccSearch/s/article/H000007955
producer:
name: Yahoo! Japan Corp.
url: https://www.yahoo.co.jp/
Expand Down Expand Up @@ -5692,3 +5701,30 @@
producer:
name: Crissy Field GmbH
url: https://www.crissyfield.de/
-
user_agent: Mozilla/5.0 researchscan.comsys.rwth-aachen.de
bot:
name: Research Scan
category: Crawler
url: http://researchscan.comsys.rwth-aachen.de/
producer:
name: RWTH Aachen University
url: https://www.comsys.rwth-aachen.de/
-
user_agent: newspaper/0.2.8
bot:
name: Scraping Robot
category: Crawler
url: https://scrapingrobot.com/
producer:
name: Sprious LLC
url: https://sprious.com/
-
user_agent: Google
bot:
name: Googlebot
category: Search bot
url: http://www.google.com/bot.html
producer:
name: Google Inc.
url: http://www.google.com
Loading

0 comments on commit a9f29e5

Please sign in to comment.