Last month I was testing the new Google Gemini Pro 2.5 model. So I figured I’d try a small little code project, built using assistance from Gemini.
With the trade war launched by the USA, our family has been dumping any American products & services and buying from Canada instead. Bye-bye Netfix and Amazon Prime! Instead we became subscribers to CBC Gem streaming TV service. I found that CBC often has streaming sports on, but I kept forgetting to check their online schedule for my favorite sport: Volleyball.
I wanted to write a web page scaper that would pull the scheduled events off the CBC schedule and add them to a personal Google Calendar, that I could toggle on/off of my own Google Calendar view. Since I check my Google Calendar all the time, I would notice if an upcoming CBC Sports event was worth watching.
So, turing to Google Gemini, I prompted as shown:
This resulted in a useful set of code (3 Python files) along with setup instructions covering:
I added this initial structure to a Github Repo, then was able to click the ‘Import Code’ button in Google Gemini’s chat box, allowing my project to be seen by Gemini. Ideally, I would be able to share my local folder (with uncommitted changes), but I didn’t see that option yet.
Looking at the generated code, I was impressed that all the relevant Google Cloud libraries were present and ready for use. Gemini chose the BeautifulSoup library for scraping and even took into account the time change difference (EST for CBC and MST for me).
This actually took me quite a while as I initially incorrectly chose an OAuth Client in my Google Cloud Console for this new app, of type “web application”. This resulted in issues related to missing redirect_uri
which I worked through with Gemini.
However, the correct type to use in case of this script is “desktop application”. Then the OAuth configuration started working for me, allowing me to fully execute the Calendar API.
To guard against duplicate event creation, I asked Gemini to modify a method to deduplicate on processing:
This gave me a quick win to make the code more resilient against source page changes in the future.
After running my script, the events are in my calendar:
Adding the following to my local crontab, let’s me run it daily:
30 9 * * * /usr/bin/bash -c 'if [ -f /path/to/project/cbc-sports-calendar/events_creator.py ]; then pushd /path/to/project/cbc-sports-calendar && /usr/bin/python3 /path/to/project/cbc-sports-calendar/events_creator.py && popd; fi'
Of course, if the headless cron run encounters an authentication token expiry, it won’t be able to pop open a browser window, but I can run it manually every once in a while.
I don’t feel I was “vibe coding” this entirely… to be honest, I did sneak over to StackOverflow occassionally. However, I did find the generated code output and the problem solving, particularly with Google Cloud OAuth flow setup, done by Gemini was very helpful. I can see how this has changed the practice and profession of programming forever.