Skip to content

Commit 6bdb060

Browse files
committed
Fixed issues parsing Google-Read-Aloud.
Fixed failing tests.
1 parent dc2e53a commit 6bdb060

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/mappings/apps.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public static function get() : array {
110110
'FlipboardProxy/' => new props('start', $fn['appslash']),
111111
'Emacs/' => new props('start', $fn['appslash']),
112112
'AndroidDownloadManager/' => new props('start', $fn['appslash']),
113-
'Google-Read-Aloud' => new props('exact', $fn['appslash']),
114113
'Zoom ' => new props('start', fn (string $value) : array => [
115114
'app' => 'Zoom',
116115
'appname' => 'Zoom',

src/mappings/crawlers.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,14 @@ public static function getApp(string $value, array $data = []) : array {
198198
],
199199
'yisouspider' => [
200200
'app' => 'Yisou Spider'
201+
],
202+
'google-read-aloud' => [
203+
'app' => 'Google Read Aloud'
201204
]
202205
];
203206
return \array_merge([
204207
'type' => 'robot',
205-
'category' => \mb_stripos($value, 'crawler') !== false || \mb_stripos($value, 'bot') !== false ? 'crawler' : 'scraper',
208+
'category' => \mb_stripos($value, 'crawl') !== false || \mb_stripos($value, 'bot') !== false ? 'crawler' : 'scraper',
206209
'app' => $parts[0],
207210
'appname' => $parts[0],
208211
'appversion' => empty($parts[1]) ? null : $parts[1]
@@ -252,6 +255,7 @@ public static function get() : array {
252255
'facebookexternalhit/' => new props('start', $fn['map']),
253256
'Google-Site-Verification/' => new props('start', $fn['map']),
254257
'Google-InspectionTool/' => new props('start', $fn['map']),
258+
'Google-Read-Aloud' => new props('exact', $fn['feed']),
255259
'Mediapartners-Google' => new props('start', $fn['search']),
256260
'FeedFetcher-Google' => new props('exact', $fn['feed']),
257261
'GoogleProducer' => new props('exact', $fn['feed']),
@@ -394,7 +398,7 @@ public static function get() : array {
394398
'bot/' => new props('any', $fn['map']),
395399
'bot-' => new props('any', $fn['map']),
396400
' bot ' => new props('any', $fn['map']),
397-
'bot' => new props('end', $fn['map'])
401+
'bot' => new props('end', $fn['map']),
398402
];
399403
}
400404
}

tests/appsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testApps() : void {
4545
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)' => [
4646
'string' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)',
4747
'type' => 'robot',
48-
'category' => 'crawler',
48+
'category' => 'feed',
4949
'architecture' => 'x86',
5050
'bits' => 64,
5151
'kernel' => 'Linux',
@@ -54,7 +54,7 @@ public function testApps() : void {
5454
'engineversion' => '41.0.2272.118',
5555
'browser' => 'Chrome',
5656
'browserversion' => '41.0.2272.118',
57-
'app' => 'Google-Read-Aloud',
57+
'app' => 'Google Read Aloud',
5858
'appname' => 'Google-Read-Aloud',
5959
'url' => 'https://support.google.com/webmasters/answer/1061943'
6060
],

tests/crawlersTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testSearch() : void {
8181
'type' => 'robot',
8282
'category' => 'search',
8383
'appversion' => '2.0',
84-
'app' => 'Baiduspider',
84+
'app' => 'Baidu Spider',
8585
'appname' => 'Baiduspider'
8686
],
8787
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)' => [

0 commit comments

Comments
 (0)