feat: add api aggregations

This commit is contained in:
2026-08-08 23:37:54 +05:30
parent 5848cf9ff4
commit 30a5055d7c
14 changed files with 70411 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# import requests
from datetime import datetime
import json
# response = requests.get(
# "https://devnovate.co/api/v1/events",
# 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("devnovate.json", "w", encoding="utf-8") as file:
# file.write(response.text)
with open("devnovate.json") as file:
hackathons = json.loads(file.read())
for hackathon in hackathons:
if (
hackathon["registrationStatus"] != "OPEN"
or hackathon["name"] == "test"
or (
hackathon["eventType"] != "hackathon"
and "hackathon" not in hackathon["name"]
and "hackathon" not in hackathon["subtitle"]
)
):
continue
name = hackathon["name"]
location = hackathon["location"]
event_date = hackathon["startDate"]
reg_end = datetime.fromisoformat(hackathon["registrationDeadline"])
if reg_end.timestamp() < datetime.now().timestamp():
continue
print(name)
print(f"Location: {location}")
print(f"Event Date: {event_date}")
print(f"Registration End: {reg_end.date()}")
print()