@@ -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 { |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | 'category' => 'feed' |
| 160 | 160 | ] |
| 161 | 161 | )), |
| 162 | - 'crawler' => function (string $value) : array { |
|
| 162 | + 'crawler' => function(string $value) : array { |
|
| 163 | 163 | return self::getApp($value, ['category' => 'crawler']); |
| 164 | 164 | }, |
| 165 | 165 | 'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']), |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | 'type' => 'robot', |
| 172 | 172 | 'categpry' => 'scraper' |
| 173 | 173 | ]), |
| 174 | - 'Moblie' => new props('exact', [ // some samsung devices mispelt it |
|
| 174 | + 'Moblie' => new props('exact', [// some samsung devices mispelt it |
|
| 175 | 175 | 'type' => 'robot', |
| 176 | 176 | 'category' => 'scraper' |
| 177 | 177 | ]), |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | 'Siteimprove.com' => new props('any', $fn['crawler']), |
| 197 | 197 | 'SEOlyt/' => new props('any', $fn['crawler']), |
| 198 | 198 | 'CyotekWebCopy' => new props('start', $fn['scraper']), |
| 199 | - 'Yandex' => new props('start', function (string $value) : array { |
|
| 199 | + 'Yandex' => new props('start', function(string $value) : array { |
|
| 200 | 200 | $parts = \explode('/', $value, 3); |
| 201 | 201 | return [ |
| 202 | 202 | 'type' => 'robot', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | ]; |
| 208 | 208 | }), |
| 209 | 209 | 'Google Page Speed Insights' => new props('exact', $fn['validator']), |
| 210 | - 'Qwantify' => new props('start', function (string $value) : array { |
|
| 210 | + 'Qwantify' => new props('start', function(string $value) : array { |
|
| 211 | 211 | $parts = \explode('/', $value, 3); |
| 212 | 212 | return [ |
| 213 | 213 | 'type' => 'robot', |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'HostTracker/' => new props('start', $fn['monitor']), |
| 254 | 254 | 'NCSC Web Check [email protected]' => new props('exact', $fn['monitor']), |
| 255 | 255 | 'Enhanced WebCheck [email protected]' => new props('exact', $fn['monitor']), |
| 256 | - 'Pingdom.com' => new props('start', function (string $value) : array { |
|
| 256 | + 'Pingdom.com' => new props('start', function(string $value) : array { |
|
| 257 | 257 | $version = \explode('_', \trim($value, '_')); |
| 258 | 258 | return [ |
| 259 | 259 | 'type' => 'robot', |
@@ -282,14 +282,14 @@ discard block |
||
| 282 | 282 | 'PhxBot/' => new props('start', $fn['feed']), // proton mail |
| 283 | 283 | 'Embedly/' => new props('start', $fn['feed']), |
| 284 | 284 | 'PayPal IPN' => new props('exact', $fn['feed']), |
| 285 | - 'Pleroma' => new props('start', fn (string $value) : array => [ // mastodon |
|
| 285 | + 'Pleroma' => new props('start', fn (string $value) : array => [// mastodon |
|
| 286 | 286 | 'type' => 'robot', |
| 287 | 287 | 'category' => 'feed', |
| 288 | 288 | 'app' => 'Mastodon', |
| 289 | 289 | 'appname' => 'Pleroma', |
| 290 | 290 | 'appversion' => \mb_substr($value, 8) |
| 291 | 291 | ]), |
| 292 | - 'Outlook-Android/' => new props('start', fn (string $value) : array => [ // mastodon |
|
| 292 | + 'Outlook-Android/' => new props('start', fn (string $value) : array => [// mastodon |
|
| 293 | 293 | 'type' => 'robot', |
| 294 | 294 | 'category' => 'feed', |
| 295 | 295 | 'app' => 'Outlook', |
@@ -297,13 +297,13 @@ discard block |
||
| 297 | 297 | 'platform' => 'Android', |
| 298 | 298 | 'appversion' => \mb_substr($value, 16) |
| 299 | 299 | ]), |
| 300 | - 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [ // mastodon |
|
| 300 | + 'Outlook-iOS/' => new props('start', fn (string $value, int $i, array $tokens) : array => [// mastodon |
|
| 301 | 301 | 'type' => 'robot', |
| 302 | 302 | 'category' => 'feed', |
| 303 | 303 | 'app' => 'Outlook', |
| 304 | 304 | 'appname' => 'Outlook-iOS', |
| 305 | 305 | 'platform' => 'iOS', |
| 306 | - 'appversion' => $tokens[$i+1] ?? \mb_substr($value, 12) |
|
| 306 | + 'appversion' => $tokens[$i + 1] ?? \mb_substr($value, 12) |
|
| 307 | 307 | ]), |
| 308 | 308 | 'OutlookMobileCloudService-Autodetect/' => new props('start', fn (string $value) : array => [ |
| 309 | 309 | 'type' => 'robot', |
@@ -312,11 +312,11 @@ discard block |
||
| 312 | 312 | 'appname' => 'OutlookMobileCloudService-Autodetect', |
| 313 | 313 | 'appversion' => \mb_substr($value, 37) |
| 314 | 314 | ]), |
| 315 | - 'HubSpot Connect ' => new props('start', function (string $value, int $i, array $tokens) : array { |
|
| 315 | + 'HubSpot Connect ' => new props('start', function(string $value, int $i, array $tokens) : array { |
|
| 316 | 316 | $app = 'HubSpot Connect'; |
| 317 | 317 | for ($n = $i; $n < \count($tokens); $n++) { |
| 318 | 318 | if (\str_starts_with($tokens[$n], 'namespace: ')) { |
| 319 | - $app = \mb_substr($tokens[$n], 11).' - '.$tokens[$n+1]; |
|
| 319 | + $app = \mb_substr($tokens[$n], 11).' - '.$tokens[$n + 1]; |
|
| 320 | 320 | break; |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -346,8 +346,8 @@ discard block |
||
| 346 | 346 | 'GoogleDocs' => new props('exact', fn (string $value, int $i, array $tokens) : array => [ |
| 347 | 347 | 'type' => 'robot', |
| 348 | 348 | 'category' => 'feed', |
| 349 | - 'app' => 'Google Docs ('.\mb_convert_case(\str_ireplace('apps-', '', $tokens[$i+1]), MB_CASE_TITLE).')', |
|
| 350 | - 'appname' => $value.'; '.$tokens[$i+1] |
|
| 349 | + 'app' => 'Google Docs ('.\mb_convert_case(\str_ireplace('apps-', '', $tokens[$i + 1]), MB_CASE_TITLE).')', |
|
| 350 | + 'appname' => $value.'; '.$tokens[$i + 1] |
|
| 351 | 351 | ]), |
| 352 | 352 | 'Google-Lens' => new props('exact', $fn['feed']), |
| 353 | 353 | 'ManicTime/' => new props('start', $fn['feed']), |