removed sensitive info
parent
a2dfc18358
commit
8466b9acbc
17
app.py
17
app.py
|
@ -95,13 +95,18 @@ END:VCALENDAR
|
|||
# Usage example
|
||||
if __name__ == "__main__":
|
||||
|
||||
if len(sys.argv) != 5:
|
||||
print("Usage: python3 app.py <caldav_url> <username> <password> <ra_api_key>")
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue