@@ -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 { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | 'category' => 'feed' |
222 | 222 | ] |
223 | 223 | )), |
224 | - 'crawler' => function (string $value) : array { |
|
224 | + 'crawler' => function(string $value) : array { |
|
225 | 225 | return self::getApp($value, ['category' => 'crawler']); |
226 | 226 | }, |
227 | 227 | 'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']), |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | 'type' => 'robot', |
234 | 234 | 'categpry' => 'scraper' |
235 | 235 | ]), |
236 | - 'Moblie' => new props('exact', [ // some samsung devices mispelt it |
|
236 | + 'Moblie' => new props('exact', [// some samsung devices mispelt it |
|
237 | 237 | 'type' => 'robot', |
238 | 238 | 'category' => 'scraper' |
239 | 239 | ]), |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ], $fn['crawler']($value))), |
267 | 267 | 'SEOlyt/' => new props('any', $fn['crawler']), |
268 | 268 | 'CyotekWebCopy' => new props('start', $fn['scraper']), |
269 | - 'Yandex' => new props('start', function (string $value) : array { |
|
269 | + 'Yandex' => new props('start', function(string $value) : array { |
|
270 | 270 | $parts = \explode('/', $value, 3); |
271 | 271 | return [ |
272 | 272 | 'type' => 'robot', |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | ]; |
278 | 278 | }), |
279 | 279 | 'Google Page Speed Insights' => new props('exact', $fn['validator']), |
280 | - 'Qwantify' => new props('start', function (string $value) : array { |
|
280 | + 'Qwantify' => new props('start', function(string $value) : array { |
|
281 | 281 | $parts = \explode('/', $value, 3); |
282 | 282 | return [ |
283 | 283 | 'type' => 'robot', |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | 'HostTracker/' => new props('start', $fn['monitor']), |
335 | 335 | 'NCSC Web Check [email protected]' => new props('exact', $fn['monitor']), |
336 | 336 | 'Enhanced WebCheck [email protected]' => new props('exact', $fn['monitor']), |
337 | - 'Pingdom.com' => new props('start', function (string $value) : array { |
|
337 | + 'Pingdom.com' => new props('start', function(string $value) : array { |
|
338 | 338 | $version = \explode('_', \trim($value, '_')); |
339 | 339 | return [ |
340 | 340 | 'type' => 'robot', |
@@ -364,14 +364,14 @@ discard block |
||
364 | 364 | 'Embedly/' => new props('start', $fn['feed']), |
365 | 365 | 'PayPal IPN' => new props('exact', $fn['feed']), |
366 | 366 | 'DropboxPreviewBot/' => new props('start', $fn['feed']), |
367 | - 'Pleroma' => new props('start', fn (string $value) : array => [ // mastodon |
|
367 | + 'Pleroma' => new props('start', fn (string $value) : array => [// mastodon |
|
368 | 368 | 'type' => 'robot', |
369 | 369 | 'category' => 'feed', |
370 | 370 | 'app' => 'Mastodon', |
371 | 371 | 'appname' => 'Pleroma', |
372 | 372 | 'appversion' => \mb_substr($value, 8) |
373 | 373 | ]), |
374 | - 'Outlook-Android/' => new props('start', fn (string $value) : array => [ // mastodon |
|
374 | + 'Outlook-Android/' => new props('start', fn (string $value) : array => [// mastodon |
|
375 | 375 | 'type' => 'robot', |
376 | 376 | 'category' => 'feed', |
377 | 377 | 'app' => 'Outlook', |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | 'platform' => 'Android', |
380 | 380 | 'appversion' => \mb_substr($value, 16) |
381 | 381 | ]), |
382 | - 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [ // mastodon |
|
382 | + 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [// mastodon |
|
383 | 383 | 'type' => 'robot', |
384 | 384 | 'category' => 'feed', |
385 | 385 | 'app' => 'Outlook', |
386 | 386 | 'appname' => 'Outlook-iOS', |
387 | 387 | 'platform' => 'iOS', |
388 | - 'appversion' => $tokens[$i+1] ?? \mb_substr($value, 12) |
|
388 | + 'appversion' => $tokens[$i + 1] ?? \mb_substr($value, 12) |
|
389 | 389 | ]), |
390 | 390 | 'OutlookMobileCloudService-Autodetect/' => new props('start', fn (string $value) : array => [ |
391 | 391 | 'type' => 'robot', |
@@ -394,12 +394,12 @@ discard block |
||
394 | 394 | 'appname' => 'OutlookMobileCloudService-Autodetect', |
395 | 395 | 'appversion' => \mb_substr($value, 37) |
396 | 396 | ]), |
397 | - 'HubSpot Connect ' => new props('start', function (string $value, int $i, array $tokens) : array { |
|
397 | + 'HubSpot Connect ' => new props('start', function(string $value, int $i, array $tokens) : array { |
|
398 | 398 | $app = 'HubSpot Connect'; |
399 | 399 | $count = \count($tokens); |
400 | 400 | for ($n = $i; $n < $count; $n++) { |
401 | 401 | if (\str_starts_with($tokens[$n], 'namespace: ')) { |
402 | - $app = \mb_substr($tokens[$n], 11).' - '.$tokens[$n+1]; |
|
402 | + $app = \mb_substr($tokens[$n], 11).' - '.$tokens[$n + 1]; |
|
403 | 403 | break; |
404 | 404 | } |
405 | 405 | } |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | 'type' => 'robot', |
431 | 431 | 'category' => 'feed', |
432 | 432 | 'app' => 'Google Docs', |
433 | - 'appname' => $value.'; '.$tokens[$i+1] |
|
433 | + 'appname' => $value.'; '.$tokens[$i + 1] |
|
434 | 434 | ]), |
435 | 435 | 'Google-Lens' => new props('exact', $fn['feed']), |
436 | 436 | 'ManicTime/' => new props('start', $fn['feed']), |