-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWire.py
More file actions
67 lines (49 loc) · 1.65 KB
/
Copy pathWire.py
File metadata and controls
67 lines (49 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import requests
from rich.console import Console
from rich.rule import Rule
import beaupy
import json
from dotenv import load_dotenv
load_dotenv()
BANNER = '''[magenta]
██╗ ██╗██╗██████╗ ███████╗
██║ ██║██║██╔══██╗██╔════╝
██║ █╗ ██║██║██████╔╝█████╗
██║███╗██║██║██╔══██╗██╔══╝
╚███╔███╔╝██║██║ ██║███████╗
╚══╝╚══╝ ╚═╝╚═╝ ╚═╝╚══════╝
by [green]https://github.com/therealOri[/green]
[/magenta]
'''
def clear():
os.system("clear||cls")
def main():
console = Console()
console.print(BANNER)
API_KEY = os.getenv("API_KEY")
if not API_KEY:
API_KEY = beaupy.prompt("Abstractapi Key - ( https://abstractapi.com ): ", secure=True)
if not API_KEY:
clear()
quit()
PHONE_NUMBER = beaupy.prompt("11 digit phone number - (14152007986): ")
if not PHONE_NUMBER:
clear()
quit()
url = f"https://phonevalidation.abstractapi.com/v1/?api_key={API_KEY}&phone={PHONE_NUMBER}"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
console.rule(f"Results for number: '{PHONE_NUMBER}'\n")
for key, value in data.items():
key = key.replace("_", " ").title()
console.print(f"[green][+][/green] {key}: {value}")
else:
clear()
console.input(f'Unable to make request. Error code: [red]{response.status_code}[/red]\n\nPress "enter" to exit...')
clear()
quit()
if __name__ == '__main__':
clear()
main()