Skip to content

Commit eeae0f8

Browse files
committed
add: LinkedIn username validation (social category)
Uses Twitterbot User-Agent to bypass LinkedIn's anti-bot detection (HTTP 999). LinkedIn whitelists social media crawler bots for link previews, serving proper responses: 200/301 for existing profiles, 404 for non-existing ones.
1 parent 0cc9ca1 commit eeae0f8

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)