@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace hexydec\agentzero; |
| 4 | 4 | |
| 5 | 5 | class crawlers { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'category' => 'feed' |
| 49 | 49 | ] |
| 50 | 50 | )), |
| 51 | - 'crawler' => function (string $value) : array { |
|
| 51 | + 'crawler' => function(string $value) : array { |
|
| 52 | 52 | $parts = \explode('/', $value, 2); |
| 53 | 53 | $map = [ |
| 54 | 54 | 'baiduspider' => 'search', |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | }, |
| 65 | 65 | 'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']), |
| 66 | 66 | 'scraper' => fn (string $value) : array => self::getApp($value, ['category' => 'scraper']), |
| 67 | - 'map' => function (string $value) : ?array { |
|
| 67 | + 'map' => function(string $value) : ?array { |
|
| 68 | 68 | if (!\str_contains($value, '://') && \strcasecmp('Cubot', $value) !== 0 && \strcasecmp('Power bot', $value) !== 0) { // bot will be in the URL |
| 69 | 69 | $parts = \explode('/', $value, 2); |
| 70 | 70 | $category = [ |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | 'Siteimprove.com' => new props('any', $fn['crawler']), |
| 264 | 264 | 'CyotekWebCopy' => new props('start', $fn['scraper']), |
| 265 | 265 | 'Google Page Speed Insights' => new props('exact', $fn['validator']), |
| 266 | - 'Qwantify' => new props('start', function (string $value) : array { |
|
| 266 | + 'Qwantify' => new props('start', function(string $value) : array { |
|
| 267 | 267 | $parts = \explode('/', $value, 3); |
| 268 | 268 | return [ |
| 269 | 269 | 'type' => 'robot', |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | 'Uptime/' => new props('start', $fn['monitor']), |
| 297 | 297 | 'HostTracker/' => new props('start', $fn['monitor']), |
| 298 | 298 | 'NCSC Web Check [email protected]' => new props('exact', $fn['map']), |
| 299 | - 'Pingdom.com' => new props('start', function (string $value) : array { |
|
| 299 | + 'Pingdom.com' => new props('start', function(string $value) : array { |
|
| 300 | 300 | $version = \explode('_', \trim($value, '_')); |
| 301 | 301 | return [ |
| 302 | 302 | 'type' => 'robot', |
@@ -322,14 +322,14 @@ discard block |
||
| 322 | 322 | 'MicrosoftPreview/' => new props('start', $fn['feed']), |
| 323 | 323 | 'YahooMailProxy' => new props('exact', $fn['feed']), |
| 324 | 324 | 'PhxBot/' => new props('start', $fn['feed']), // proton mail |
| 325 | - 'Pleroma' => new props('start', fn (string $value) : array => [ // mastodon |
|
| 325 | + 'Pleroma' => new props('start', fn (string $value) : array => [// mastodon |
|
| 326 | 326 | 'type' => 'robot', |
| 327 | 327 | 'category' => 'feed', |
| 328 | 328 | 'app' => 'Mastodon', |
| 329 | 329 | 'appname' => 'Pleroma', |
| 330 | 330 | 'appversion' => \mb_substr($value, 8) |
| 331 | 331 | ]), |
| 332 | - 'Outlook-Android/' => new props('start', fn (string $value) : array => [ // mastodon |
|
| 332 | + 'Outlook-Android/' => new props('start', fn (string $value) : array => [// mastodon |
|
| 333 | 333 | 'type' => 'robot', |
| 334 | 334 | 'category' => 'feed', |
| 335 | 335 | 'app' => 'Outlook', |
@@ -337,15 +337,15 @@ discard block |
||
| 337 | 337 | 'platform' => 'Android', |
| 338 | 338 | 'appversion' => \mb_substr($value, 16) |
| 339 | 339 | ]), |
| 340 | - 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [ // mastodon |
|
| 340 | + 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [// mastodon |
|
| 341 | 341 | 'type' => 'robot', |
| 342 | 342 | 'category' => 'feed', |
| 343 | 343 | 'app' => 'Outlook', |
| 344 | 344 | 'appname' => 'Outlook-iOS', |
| 345 | 345 | 'platform' => 'iOS', |
| 346 | - 'appversion' => $tokens[$i+1] ?? \mb_substr($value, 12) |
|
| 346 | + 'appversion' => $tokens[$i + 1] ?? \mb_substr($value, 12) |
|
| 347 | 347 | ]), |
| 348 | - 'OutlookMobileCloudService-Autodetect/' => new props('start', fn (string $value) : array => [ // mastodon |
|
| 348 | + 'OutlookMobileCloudService-Autodetect/' => new props('start', fn (string $value) : array => [// mastodon |
|
| 349 | 349 | 'type' => 'robot', |
| 350 | 350 | 'category' => 'feed', |
| 351 | 351 | 'app' => 'Outlook', |