From 86674b96d1f3a7af64eb27460608fc1efcb5aae0 Mon Sep 17 00:00:00 2001 From: kaifcodec Date: Fri, 20 Mar 2026 19:14:07 +0530 Subject: [PATCH] add: 3 new user_scan modules to finance directory --- user_scanner/user_scan/finance/advfn.py | 16 +++++++++++++++ user_scanner/user_scan/finance/etoro.py | 25 ++++++++++++++++++++++++ user_scanner/user_scan/finance/hamaha.py | 17 ++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 user_scanner/user_scan/finance/advfn.py create mode 100644 user_scanner/user_scan/finance/etoro.py create mode 100644 user_scanner/user_scan/finance/hamaha.py diff --git a/user_scanner/user_scan/finance/advfn.py b/user_scanner/user_scan/finance/advfn.py new file mode 100644 index 0000000..2070fb6 --- /dev/null +++ b/user_scanner/user_scan/finance/advfn.py @@ -0,0 +1,16 @@ +from user_scanner.core.orchestrator import generic_validate, Result + +def validate_advfn(user): + url = f"https://uk.advfn.com/forum/profile/{user}" + show_url = url + + def process(response): + if "Profile | ADVFN" in response.text: + return Result.taken() + + if "ADVFN ERROR - Page Not Found" in response.text: + return Result.available() + + return Result.error("Unexpected response body, report it via GitHub issues.") + + return generic_validate(url, process, show_url=show_url) diff --git a/user_scanner/user_scan/finance/etoro.py b/user_scanner/user_scan/finance/etoro.py new file mode 100644 index 0000000..b151833 --- /dev/null +++ b/user_scanner/user_scan/finance/etoro.py @@ -0,0 +1,25 @@ +from user_scanner.core.orchestrator import generic_validate, Result + +def validate_etoro(user): + url = f"https://www.etoro.com/api/logininfo/v1.1/users/{user}" + show_url = f"https://www.etoro.com/people/{user}" + + headers = { + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36", + "Accept": "application/json", + "Referer": "https://www.etoro.com/" + } + + def process(response): + if '"gcid":' in response.text: + return Result.taken() + + if '"ErrorCode":"NotFound"' in response.text: + return Result.available() + + if response.status_code == 403: + return Result.error("Blocked by Cloudflare protection.") + + return Result.error("Unexpected API response format.") + + return generic_validate(url, process, headers=headers, show_url=show_url) diff --git a/user_scanner/user_scan/finance/hamaha.py b/user_scanner/user_scan/finance/hamaha.py new file mode 100644 index 0000000..15055c8 --- /dev/null +++ b/user_scanner/user_scan/finance/hamaha.py @@ -0,0 +1,17 @@ +from user_scanner.core.orchestrator import generic_validate, Result + +def validate_hamaha(user): + url = f"https://hamaha.net/{user}" + show_url = url + + def process(response): + if 'id="profile"' in response.text: + return Result.taken() + + if 'content="HAMAHA Биткоин форум. Торговля на бирже - ➨ Обучение Криптовалютам, Биткоин и NYSE "' in response.text: + return Result.available() + + return Result.error("Unexpected response body, report it via GitHub issues.") + + return generic_validate(url, process, show_url=show_url) +