Skip to content

Commit 54b2988

Browse files
authored
Merge pull request #264 from SylvainM98/add/linkedin-username-module
add: LinkedIn username validation (social category)
2 parents 67a4ae6 + eeae0f8 commit 54b2988

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from user_scanner.core.orchestrator import status_validate
2+
from user_scanner.core.result import Result
3+
4+
5+
def validate_linkedin(user: str) -> Result:
6+
# LinkedIn whitelists social media crawler bots for link previews,
7+
# bypassing the anti-bot 999 response that blocks regular user agents.
8+
# Note: bulk scanning may trigger rate limiting (999) after ~3 rapid requests.
9+
url = f"https://www.linkedin.com/in/{user}"
10+
show_url = "https://linkedin.com"
11+
12+
headers = {
13+
"User-Agent": "Twitterbot/1.0",
14+
}
15+
16+
return status_validate(
17+
url, available=404, taken=[200, 301], show_url=show_url,
18+
headers=headers, follow_redirects=False
19+
)

0 commit comments

Comments
 (0)