Small project to learn a bit of web scraping, OAuth authentication and calling APIs in Python.
The problem I was having was that I didn't want to have to go through Otago's key dates page and manually add all the events I needed to keep track of. So I devised a Python script to do it for me.
- Language: Python
- Libraries: BeautifulSoup
- API Google API Python Client
KeyDatesToGoogleCal.py
- Main script to scrape the key dates page and add them to the user's Google CalendarauthenticateUser.py
- Small script to authenticate the user with Google Calendar APIdeleteAllCalendarEvents.py
- Small script to delete all events from the user's Google Calendar (useful for testing)
Documentation.ipynb
- A notebook to document the process of building the project
- Clone the repo using Git
gh repo clone JamesRobionyRogers/UniversityOfOtago-KeyDates-to-Calendar
- Install the required packages
pip install
-
Change the
calendarId
variable inKeyDatesToGoogleCal.py
to your Google Calendar ID. You can find this by going to your Google Calendar settings and copying the Calendar ID. -
Run the script
python KeyDatesToGoogleCal.py
- Follow the prompts to authenticate the script with your Google account.
Here are a couple of improvements I would like to make to this project in the future
- Create improvements on the filter as there are still some irrelevant events being added to the calendar
- Could be done through removing events that contain certain words from the already filtered events