fix(share): add more social media bot user agents

Add facebookcatalog, meta-externalagent, pinterestbot and organize
bot list with comments by platform.
pull/3227/head
WittF 1 week ago
parent 4ef97bf244
commit d9f0612819
No known key found for this signature in database

@ -5,14 +5,25 @@ import "strings"
// IsSocialMediaBot checks if the User-Agent belongs to a social media crawler.
func IsSocialMediaBot(ua string) bool {
bots := []string{
// Meta (Facebook, Instagram, WhatsApp)
"facebookexternalhit",
"facebookcatalog",
"facebot",
"meta-externalagent",
// Twitter/X
"twitterbot",
// LinkedIn
"linkedinbot",
"whatsapp",
"slackbot",
// Discord
"discordbot",
// Telegram
"telegrambot",
"facebot",
// Slack
"slackbot",
// WhatsApp
"whatsapp",
// Pinterest
"pinterestbot",
}
ua = strings.ToLower(ua)
for _, bot := range bots {

Loading…
Cancel
Save