Skip to content

Commit 837d319

Browse files
committed
[extensions][helpers] Update Semrush bot variants
1 parent 6f0191c commit 837d319

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed

package-lock.json

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extensions/ua-parser-extensions.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const Crawlers = Object.freeze({
5252
// MojeekBot - https://www.mojeek.com/bot.html
5353
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots
5454
// PerplexityBot - https://perplexity.ai/perplexitybot
55-
// SemrushBot - http://www.semrush.com/bot.html
5655
// SeznamBot - http://napoveda.seznam.cz/seznambot-intro
5756
/((?:ahrefs|amazon|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush|seznam)bot)\/([\w\.-]+)/i,
5857

@@ -78,6 +77,9 @@ const Crawlers = Object.freeze({
7877
// Internet Archive (archive.org)
7978
/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,
8079

80+
// SemrushBot - http://www.semrush.com/bot.html
81+
/((?:semrush|splitsignal)bot[-abcfimostw]*)\/([\w\.-]+)/i,
82+
8183
// Sogou Spider
8284
/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,
8385

@@ -217,10 +219,10 @@ const Fetchers = Object.freeze({
217219
// AhrefsSiteAudit - https://ahrefs.com/robot/site-audit
218220
// ChatGPT-User - https://platform.openai.com/docs/plugins/bot
219221
// DuckAssistBot - https://duckduckgo.com/duckassistbot/
220-
// BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / Telegrambot / Twitterbot / UptimeRobot
222+
// BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / SiteAuditBot / Telegrambot / Twitterbot / UptimeRobot
221223
// Google Site Verifier / Meta / Yahoo! Japan
222224
// Yandex Bots - https://yandex.com/bots
223-
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot|google-site-verification|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i,
225+
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|telegram|twitter|uptimero)bot|google-site-verification|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i,
224226

225227
// Bluesky
226228
/(bluesky) cardyb\/([\w\.]+)/i,

src/helpers/ua-parser-helpers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ const isAIBot = (resultOrUA) => [
9393
// Perplexity
9494
'perplexitybot',
9595

96+
// Semrush
97+
'semrushbot-ocob',
98+
9699
// Timpi
97100
'timpibot',
98101

test/data/ua/extension/crawler.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,16 @@
480480
"type" : "crawler"
481481
}
482482
},
483+
{
484+
"desc" : "SemrushBot for ContentShake AI tool",
485+
"ua" : "Mozilla/5.0 (compatible; SemrushBot-OCOB/1; +https://www.semrush.com/bot/)",
486+
"expect" :
487+
{
488+
"name" : "SemrushBot-OCOB",
489+
"version" : "1",
490+
"type" : "crawler"
491+
}
492+
},
483493
{
484494
"desc" : "SeznamBot",
485495
"ua" : "Mozilla/5.0 (compatible; SeznamBot/4.0-RC1; +http://napoveda.seznam.cz/seznambot-intro/)",

test/data/ua/extension/fetcher.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@
119119
"type" : "fetcher"
120120
}
121121
},
122+
{
123+
"desc" : "SiteAuditBot",
124+
"ua" : "Mozilla/5.0 (compatible; SiteAuditBot/0.97; +http://www.semrush.com/bot.html)",
125+
"expect" :
126+
{
127+
"name" : "SiteAuditBot",
128+
"version" : "0.97",
129+
"type" : "fetcher"
130+
}
131+
},
122132
{
123133
"desc" : "UptimeRobot",
124134
"ua" : "Mozilla/5.0 (compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)",

test/unit/helpers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ describe('isAIBot', () => {
4040
const claudeBot = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)';
4141
const firefox = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0';
4242
const searchGPT = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot';
43+
const semrushAI = 'Mozilla/5.0 (compatible; SemrushBot-OCOB/1; +https://www.semrush.com/bot/)';
4344

4445
assert.equal(isAIBot(UAParser(claudeBot, Bots)), true);
4546
assert.equal(isAIBot(claudeBot), true);
4647
assert.equal(isAIBot(firefox), false);
4748
assert.equal(isAIBot(searchGPT), true);
49+
assert.equal(isAIBot(semrushAI), true);
4850
});
4951
});
5052

0 commit comments

Comments
 (0)