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.

feat: add Lemmy username validator

Matt Kneale69e3fb35dfaa
diff --git a/user_scanner/user_scan/community/lemmy.py b/user_scanner/user_scan/community/lemmy.py
new file mode 100644
index 0000000..48cccfd
--- /dev/null
+++ b/user_scanner/user_scan/community/lemmy.py
@@ -0,0 +1,45 @@
+import re
+from user_scanner.core.orchestrator import status_validate
+from user_scanner.core.result import Result
+
+
+def validate_lemmy(user: str) -> Result:
+ """
+ Check username availability on Lemmy (lemmy.world instance).
+
+ Lemmy is a federated Reddit alternative with many instances.
+ This validator checks lemmy.world, the largest public instance.
+ Federation-wide checking is out of scope for this implementation.
+
+ API behavior:
+ - 400/404: Username does not exist (available)
+ - 200: Username exists (taken)
+ """
+ # Lemmy username rules: 3-20 chars, alphanumeric and underscores only
+ if not (3 <= len(user) <= 20):
+ return Result.error("Length must be 3-20 characters")
+
+ if not re.match(r'^[a-zA-Z0-9_]+$', user):
+ return Result.error("Only letters, numbers, and underscores allowed")
+
+ url = f"https://lemmy.world/api/v3/user?username={user}"
+
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
+ "Accept": "application/json",
+ "Accept-Encoding": "gzip, deflate, br, zstd",
+ }
+
+ return status_validate(url, [400, 404], 200, headers=headers, timeout=5.0)
+
+
+if __name__ == "__main__":
+ user = input("Username?: ").strip()
+ result = validate_lemmy(user)
+
+ if result == 1:
+ print("Available!")
+ elif result == 0:
+ print("Unavailable!")
+ else:
+ print(f"Error occurred! Reason: {result.get_reason()}")