1
1 Comment

App to put my work shifts into Google Calendar

Not really sure where to put this, but I thought I'd share it anyway.

I work at a grocery store in Australia that uses a service called WorkJam to send us our shifts for the week. However, I find the app really frustrating because it's slow and it's just annoying and repetitive to put my shifts into Google Calendar. So, I decided to make something that does this for me after taking some inspiration from Tim Ferriss' four-hour work week book.

Here's a general outline of how it works under the hood:

  1. Simulate a browser.
  2. Go to workjam website.
  3. Go through login process.
  4. Go to schedule url.
  5. Scrape the shifts from a table.
  6. Parse the data.
  7. Use gcalcli terminal command to handle putting data into Google Calendar.

The technical stuff:

  • I'm running this all in a Linux Docker container and developing locally using WSL2 Ubuntu 20.04 in Visual Studio. This image will be run once a week on a Monday at some point on the AWS Elastic Container Service.
  • I'm using .NET 6 for this as I've had experience with this before and I like C#, but I could've written it with any other language if I really wanted to.
  • I initially decided to use Selenium for the browser emulation. However, I ran into issues getting the chromedriver installed and Selenium isn't updated for .NET 6 yet, so I decided to look for an alternative.
  • I settled on a Microsoft maintained solution called PlayWright. This works great as it has lots of great tools packaged with it and it handles the browser downloads for Chrome, Firefox, and Webkit.
  • I basically just followed the login process from here. Once I'd reached the page for the schedule, I just did a bit of snooping and analysed the table structure to get the desired data I looked for. This was just a bit of experimentation.
  • After this, I tried using the Google Calendar API for .NET, but the docs are s**t and I was basically banging my head against a wall. A developer recommended using gcalcli and just executing it from .NET, which I figured out how to do using the CliWrap package for .NET and piped in the input I would've done on the command line with a million new lines.

I don't really know how to demonstrate it doing it as it's mostly background stuff apart from maybe a screenshare showing the before and after it's run.

Side note: Anyone who has livestreamed coding an application, how do you keep your personal details safe which in the coding environment? I was considering doing this, but I thought it would be too easy to slip up on a project like this where it's my personal login's and google calendar api keys and such.

on October 10, 2022
  1. 1

    Ha, I love this kind of automation — scratching your own itch is the best way to start building. The Google Calendar API docs being frustrating is painfully relatable. I've been building a calendar sync tool (Google ↔ Outlook) and Google's rate limit handling alone was a journey — they return 403 instead of 429 for rate limits, and their own retry library doesn't catch it. Playwright is a great choice btw, way smoother than Selenium in my experience too.

Trending on Indie Hackers
I'm a lawyer who launched an AI contract tool on Product Hunt today — here's what building it as a non-technical founder actually felt like User Avatar 142 comments “This contract looked normal - but could cost millions” User Avatar 54 comments 👉 The most expensive contract mistakes don’t feel risky User Avatar 41 comments The indie maker's dilemma: 2 months in, 700 downloads, and I'm stuck User Avatar 39 comments A simple way to keep AI automations from making bad decisions User Avatar 34 comments I spent weeks building a food decision tool instead of something useful User Avatar 28 comments