Skip to content

Commit a0dbf34

Browse files
committed
block AHrefsBot and PetalBot
1 parent 86cf1fe commit a0dbf34

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,12 @@ _.UUID = (function() {
942942
// This is to block various web spiders from executing our JS and
943943
// sending false tracking data
944944
var BLOCKED_UA_STRS = [
945+
'ahrefsbot',
945946
'baiduspider',
946947
'bingbot',
947948
'bingpreview',
948949
'facebookexternal',
950+
'petalbot',
949951
'pinterest',
950952
'screaming frog',
951953
'yahoo! slurp',

tests/test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,7 @@
36563656
test('blocked user agents', function() {
36573657
var bot_user_agents = [
36583658
"Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)",
3659+
"Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)",
36593660
"Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)",
36603661
"Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 530) like Gecko (compatible; adidxbot/2.0; +http://www.bing.com/bingbot.htm)",
36613662
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534+ (KHTML, like Gecko) BingPreview/1.0b",
@@ -3664,6 +3665,8 @@
36643665
"Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)",
36653666
"facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)",
36663667
"facebookexternalhit/1.1",
3668+
"Mozilla/5.0 (compatible;PetalBot;+http://aspiegel.com/petalbot)",
3669+
"Mozilla/5.0(Linux;Android7.0;) AppleWebKit/537.36(KHTML,likeGecko) MobileSafari/537.36(compatible;PetalBot;+http://aspiegel.com/petalbot)",
36673670
"Mozilla/5.0 (compatible; Pinterestbot/1.0; +http://www.pinterest.com/bot.html)",
36683671
"APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)",
36693672
"Mediapartners-Google",

0 commit comments

Comments
 (0)