-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:hexydec/agentzero
- Loading branch information
Showing
2 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ public static function getApp(string $value, array $data = []) : array { | |
'duckduckgo-favicons-bot' => 'search', | ||
'coccocbot-image' => 'search', | ||
'coccocbot-web' => 'search', | ||
'applebot' => 'search', | ||
'applebot' => 'ai', | ||
'yandexbot' => 'search', | ||
'mj12bot' => 'search', | ||
'mail.ru_bot' => 'search', | ||
|
@@ -59,7 +59,13 @@ public static function getApp(string $value, array $data = []) : array { | |
'telegrambot' => 'feed', | ||
'semrushbot' => 'crawler', | ||
'mediatoolkitbot' => 'crawler', | ||
'iploggerbot' => 'monitor' | ||
'iploggerbot' => 'monitor', | ||
'baiduspider' => 'search', | ||
'haosouspider' => 'search', | ||
'yisouspider' => 'search', | ||
'360spider' => 'search', | ||
'sogou web spider' => 'search', | ||
'bytespider' => 'crawler' | ||
]; | ||
$apps = [ | ||
'yacybot' => 'YacyBot', | ||
|
@@ -94,6 +100,7 @@ public static function getApp(string $value, array $data = []) : array { | |
'mediatoolkitbot' => 'MediaToolkitBot', | ||
'cfnetwork' => 'Apple Core Foundation Network', | ||
'ncsc web check [email protected]' => 'NCSC Web Check', | ||
'enhanced webcheck [email protected]' => 'NCSC Enhanced Web Check', | ||
'the national archives uk government web archive:' => 'UK Government National Archives', | ||
'google-site-verification' => 'Google Site Verification', | ||
'google-inspectiontool' => 'Google Inspection Tool', | ||
|
@@ -115,17 +122,20 @@ public static function getApp(string $value, array $data = []) : array { | |
'citoid' => 'Wikimedia Citoid', | ||
'censysinspect' => 'Censys Inspect', | ||
'googledocs' => 'Google Docs', | ||
'user-agent: seolyt' => 'SEOlyt' | ||
'user-agent: seolyt' => 'SEOlyt', | ||
'bytespider' => 'ByteDance Spider', | ||
'[email protected]' => 'ByteDance Spider' | ||
]; | ||
|
||
$lower = \mb_strtolower($parts[0]); | ||
return \array_merge([ | ||
'type' => 'robot', | ||
'category' => $category[$lower] ?? (\mb_stripos($value, 'crawl') !== false || \mb_stripos($value, 'bot') !== false ? 'crawler' : 'scraper'), | ||
'app' => $apps[$lower] ?? $parts[0], | ||
'appname' => $parts[0], | ||
'appversion' => empty($parts[1]) ? null : $parts[1] | ||
], $data); | ||
], $data, [ | ||
'category' => $category[$lower] ?? $data['category'] ?? (\mb_stripos($value, 'crawl') !== false || \mb_stripos($value, 'bot') !== false ? 'crawler' : 'scraper') | ||
]); | ||
} | ||
return []; | ||
} | ||
|
@@ -150,18 +160,7 @@ public static function get() : array { | |
] | ||
)), | ||
'crawler' => function (string $value) : array { | ||
$parts = \explode('/', $value, 2); | ||
$map = [ | ||
'baiduspider' => 'search', | ||
'haosouspider' => 'search', | ||
'yisouspider' => 'search', | ||
'360spider' => 'search', | ||
'sogou web spider' => 'search', | ||
'bytespider' => 'search', | ||
]; | ||
return self::getApp($value, [ | ||
'category' => $map[\mb_strtolower($parts[0])] ?? 'crawler' | ||
]); | ||
return self::getApp($value, ['category' => 'crawler']); | ||
}, | ||
'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']), | ||
'scraper' => fn (string $value) : array => self::getApp($value, ['category' => 'scraper']), | ||
|
@@ -253,6 +252,7 @@ public static function get() : array { | |
'Uptime/' => new props('start', $fn['monitor']), | ||
'HostTracker/' => new props('start', $fn['monitor']), | ||
'NCSC Web Check [email protected]' => new props('exact', $fn['monitor']), | ||
'Enhanced WebCheck [email protected]' => new props('exact', $fn['monitor']), | ||
'Pingdom.com' => new props('start', function (string $value) : array { | ||
$version = \explode('_', \trim($value, '_')); | ||
return [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters