video-privacy-today/main.py

24 lines
531 B
Python
Raw Normal View History

from datetime import datetime
import urllib.request
import json
def extract_day(datetime_str):
dt = datetime.strptime(datetime_str.split()[0], "%Y-%m-%d")
return(dt.date())
all_talks = None
with urllib.request.urlopen("https://www.emfcamp.org/schedule/2024.json") as url:
all_talks = json.load(url)
today = datetime.today().date()
talks_today = []
for talk in all_talks:
day = extract_day(talk["start_date"])
if day == today:
talks_today.append(talk)
print(len(all_talks))
print(len(talks_today))