Skip to content

Commit 86674b9

Browse files
committed
add: 3 new user_scan modules to finance directory
1 parent bed8516 commit 86674b9

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from user_scanner.core.orchestrator import generic_validate, Result
2+
3+
def validate_advfn(user):
4+
url = f"https://uk.advfn.com/forum/profile/{user}"
5+
show_url = url
6+
7+
def process(response):
8+
if "Profile | ADVFN" in response.text:
9+
return Result.taken()
10+
11+
if "ADVFN ERROR - Page Not Found" in response.text:
12+
return Result.available()
13+
14+
return Result.error("Unexpected response body, report it via GitHub issues.")
15+
16+
return generic_validate(url, process, show_url=show_url)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from user_scanner.core.orchestrator import generic_validate, Result
2+
3+
def validate_etoro(user):
4+
url = f"https://www.etoro.com/api/logininfo/v1.1/users/{user}"
5+
show_url = f"https://www.etoro.com/people/{user}"
6+
7+
headers = {
8+
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36",
9+
"Accept": "application/json",
10+
"Referer": "https://www.etoro.com/"
11+
}
12+
13+
def process(response):
14+
if '"gcid":' in response.text:
15+
return Result.taken()
16+
17+
if '"ErrorCode":"NotFound"' in response.text:
18+
return Result.available()
19+
20+
if response.status_code == 403:
21+
return Result.error("Blocked by Cloudflare protection.")
22+
23+
return Result.error("Unexpected API response format.")
24+
25+
return generic_validate(url, process, headers=headers, show_url=show_url)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from user_scanner.core.orchestrator import generic_validate, Result
2+
3+
def validate_hamaha(user):
4+
url = f"https://hamaha.net/{user}"
5+
show_url = url
6+
7+
def process(response):
8+
if 'id="profile"' in response.text:
9+
return Result.taken()
10+
11+
if 'content="HAMAHA Биткоин форум. Торговля на бирже - ➨ Обучение Криптовалютам, Биткоин и NYSE "' in response.text:
12+
return Result.available()
13+
14+
return Result.error("Unexpected response body, report it via GitHub issues.")
15+
16+
return generic_validate(url, process, show_url=show_url)
17+

0 commit comments

Comments
 (0)