-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest_app.py
More file actions
44 lines (34 loc) · 725 Bytes
/
test_app.py
File metadata and controls
44 lines (34 loc) · 725 Bytes
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
import requests
import json
from rich.markdown import Markdown
from rich.console import Console
from rich import print
console = Console()
username = "one"
uID = "2434"
ukey = "cfffbjewkb"
register = requests.get(f"http://127.0.0.1/register/{uID}/{username}/{ukey}")
key = register.text
print("Key Generated:")
print(key)
url = f"http://127.0.0.1/api/p1/{key}/172.67.147.95"
print(url)
response = requests.get(url)
data = response.text
data_processed = json.loads(data)
t = f"""
### API Registration Details
``
`Username:` = {username}
`Unique Key:` = {ukey}
`ID:` = {uID}
`KEY` = {key}
### AI OUTPUT
`IP` = 127.0.0.1
`Profile` = P1
```json
{data_processed["markdown"]}
```
"""
out = Markdown(t)
console.print(out)