feat: add api aggregations
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# import requests
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
# response = requests.get(
|
||||
# "https://hack2skill.com/api/v1/innovator/public/event/public-list?page=1&records=27&isRegistrationOngoing=true",
|
||||
# headers={
|
||||
# "User-Agent": (
|
||||
# "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
||||
# "AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||
# "Chrome/151.0.0.0 Safari/537.36"
|
||||
# ),
|
||||
# },
|
||||
# )
|
||||
#
|
||||
# with open("hack2skill.json", "w", encoding="utf-8") as file:
|
||||
# file.write(response.text)
|
||||
|
||||
with open("hack2skill.json") as file:
|
||||
hackathons = json.loads(file.read())["data"]
|
||||
|
||||
for hackathon in hackathons:
|
||||
name = hackathon["title"]
|
||||
reg_end = datetime.fromisoformat(hackathon["registrationEnd"]).date()
|
||||
|
||||
print(name)
|
||||
print(f"Registration End: {reg_end}")
|
||||
print()
|
||||
Reference in New Issue
Block a user