Author: Malte Bublitz
Language/File type: Python 3
Description
A small Python client module for https://github.com/hotheadhacker/no-as-a-service
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
#
# Python library for <https://github.com/hotheadhacker/no-as-a-service>
#
import json
import requests
def naas() -> str | bool:
response = requests.get("https://naas.isalman.dev/no")
if response.status_code != 200:
return False
else:
response_json = json.loads(response.content)
try:
return response_json["reason"]
except KeyError:
return False
if __name__ == "__main__":
print(naas())