From 8466b9acbcc5f44747442af38580d087ea5345f9 Mon Sep 17 00:00:00 2001 From: Chris Nutter Date: Thu, 9 Jan 2025 19:44:13 -0800 Subject: [PATCH] removed sensitive info --- app.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index a5a0db1..e771dc4 100644 --- a/app.py +++ b/app.py @@ -95,13 +95,18 @@ END:VCALENDAR # Usage example if __name__ == "__main__": + if len(sys.argv) != 5: + print("Usage: python3 app.py ") + sys.exit(1) + + CALDAV_URL = sys.argv[1] + USERNAME = sys.argv[2] + PASSWORD = sys.argv[3] + RA_API = sys.argv[4] + # CalDAV server details - CALDAV_URL = "https://cal.cdnutter.org/dav.php/calendars/cdnutter/qesvjipbzdtcahrz/" - USERNAME = "cdnutter" - PASSWORD = "ZRGiXtDHP3jvXq0d" - JSON_FILE = "https://retroachievements.org/API/API_GetAchievementOfTheWeek.php?&y=oHdON3RERFPnHV1J6Oiax5F85Wkh5Msq" + JSON = f"https://retroachievements.org/API/API_GetAchievementOfTheWeek.php?&y={RA_API}" response = requests.get(JSON_FILE) data = response.json() - create_calendar_events_from_json(CALDAV_URL, USERNAME, PASSWORD, JSON_FILE) - + create_calendar_events_from_json(CALDAV_URL, USERNAME, PASSWORD, JSON)