Skip to content

🕵️‍♂️ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.

fix(x.py): minor issues and refactor to make it work with new orchestrator

kaifcodecd4b19720a4ee
diff --git a/user_scanner/email_scan/social/x.py b/user_scanner/email_scan/social/x.py
index f095e43..d4da6f7 100644
--- a/user_scanner/email_scan/social/x.py
+++ b/user_scanner/email_scan/social/x.py
@@ -1,26 +1,38 @@
-import asyncio
import httpx
+from user_scanner.core.result import Result
-async def check_x(email):
- url = f"https://api.x.com/i/users/email_available.json?email={email}"
+async def _check(email):
+ url = "https://api.x.com/i/users/email_available.json"
+ params = {"email": email}
headers = {
"user-agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Mobile Safari/537.36",
+ "accept-encoding": "gzip, deflate, br, zstd",
+ "sec-ch-ua-platform": "\"Android\"",
+ "sec-ch-ua": "\"Google Chrome\";v=\"143\", \"Chromium\";v=\"143\", \"Not A(Brand\";v=\"24\"",
"x-twitter-client-language": "en",
+ "sec-ch-ua-mobile": "?1",
"x-twitter-active-user": "yes",
- "referer": "https://x.com/"
+ "origin": "https://x.com",
+ "sec-fetch-site": "same-site",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-dest": "empty",
+ "referer": "https://x.com/",
+ "accept-language": "en-US,en;q=0.9",
+ "priority": "u=1, i"
}
async with httpx.AsyncClient(http2=True) as client:
try:
- resp = await client.get(url, headers=headers)
- data = resp.json()
- if data.get("taken"):
- return f"[!] {email} -> REGISTERED"
- return f"[*] {email} -> NOT REGISTERED"
+ response = await client.get(url, params=params, headers=headers)
+ data = response.json()
+ taken_bool= data["taken"]
+ if taken_bool is True:
+ return Result.taken()
+
+ elif taken_bool is False:
+ return Result.available()
except Exception as e:
- return f"Error checking {email}: {e}"
+ return Result.error(e)
-if __name__ == "__main__":
- target_email = input("Enter Email: ").strip()
- result = asyncio.run(check_x(target_email))
- print(result)
+def validate_x(email: str) -> Result:
+ return _check(email)