0

Merge pull request #168 from mendableai/nsc/allowed-keywords-in-blocklist

feat: Allow privacy/legal/ other pages in social media websites
This commit is contained in:
Nicolas 2024-05-24 09:43:15 -07:00 committed by GitHub
commit 53a214cefb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
const socialMediaBlocklist = [
'facebook.com',
'twitter.com',
'x.com',
'instagram.com',
'linkedin.com',
'pinterest.com',
@ -14,12 +15,25 @@ const socialMediaBlocklist = [
'telegram.org',
];
const allowedUrls = [
'linkedin.com/pulse'
const allowedKeywords = [
'pulse',
'privacy',
'terms',
'policy',
'user-agreement',
'legal',
'help',
'support',
'contact',
'about',
'careers',
'blog',
'press',
'conditions',
];
export function isUrlBlocked(url: string): boolean {
if (allowedUrls.some(allowedUrl => url.includes(allowedUrl))) {
if (allowedKeywords.some(keyword => url.includes(keyword))) {
return false;
}