Our laboratory runs an out-of-date xoops calendar to keep track of internal events. I often happen to miss events or mis-schedule personal appointments because the calendar is detached from my personal Google calendar.
This simple application grabs the xoops calendar as HTML, parses it, and synchronizes with a Google calendar.
pip install gdata python-flags google-api-python-client
The application uses OAuth2 authentication. To run it yourself, go to https://code.google.com/apis/console, click on "API Access", and obtain the following:
- Google developer key ("API Key" under "Simple API Access", save this in gitignore/developer_key.txt)
- Client id and secret (click on "Download JSON" and save result in gitignore/client_secrets.json)
- Set up authentication as described above.
- Specify the calendars you are interested in by editing main.py (and possibly fetch.py)
- Run main.py
Every xoops calendar event has a calendar ID (cid) and an event ID (event_id). The combination of the cid and event_id uniquely identify the event. When saving events to Google calendar, the cid and event_id are written to the description field of the new Google calendar event entry. These are then used to index the Google calendar entries when updating.