I work out so I can listen to podcasts. I can’t just sit around. I have to be moving, so I head to the gym almost every day after work, choose an episode, and press play. The exercise is a side benefit. A few months ago, I opened the Google Podcasts app to an un-dissmissible message banner at the top of the screen:
After April 2, 2024, you will no longer be able to listen to podcasts in Google Podcasts.
For those who remember Google Reader, this callous cancelation of a perfectly good app reopened old wounds of the big kids taking their toys away so others couldn’t play with them. But this time things are different. After years of increasing complexity, tech is starting to feel simpler again for tinkers like me. And now we have a not-so-secret weapon: ChatGPT. Maybe it was the adrenaline from jogging or maybe it was the clarion call from 37signals to take back ownership of software from the SaaS lords. For some reason, I decided I wasn’t going to roll over and move my subscriptions to YouTube or pledge allegiance to Spotify. I was going to use this new appicide by Google to take matters into my own hands, learn something new, and build something the big kids couldn’t take away from me.
Static sites FTW
With my excitement at the launch of Campfire, I initially thought this podcast player project could be the impetus to try out a new no-code platform, or maybe a React framework, or maybe even (gasp) Ruby on Rails. But my enthusiasm was quickly tempered when I started poking around and realized how much new knowledge would be involved. Then, as I was looking at my feature list, I started to wonder how much interactivity I really needed. For each item, I indicated whether it could be done with a static site, meaning a primarily HTML site that is built “offline” and then deployed to a web host. There is generally no authentication and no database to write to, so they’re more for content-based sites. (Of course, you can throw in as much JavaScript as you want but that kind of defeats the purpose.) All I really needed to figure out was how to “subscribe” to podcasts (get the content) and manage some of the playback functionality (like saving progress and marking as played). Challenge accepted. The rest was just displaying content. And much of other functionality — sharing a link, saving a bookmark, downloading a file, and browsing your history — is available with any modern web browser.
AI is my copilot
Although audio playback on a webpage works pretty well out of the box with the audio HTML element, there were definitely some important convenience features I wanted to incorporate that required JavaScript. The two main ones were keeping track of the current time of each episode (so I could pick up where I left off after a few minutes or a few days) and being able to mark episodes as played. I had an idea of what I need to do conceptually — grab the current time every few seconds to save to the browser and then load it again when returning to that episode page — but I didn’t know the syntax so I asked ChatGPT piecemeal questions like “how do I clear an interval in one function that was started in a different function?” Once I had things basically working, I asked: “how can I improve this code?” and I pasted in the 50 or so lines I had so far. It responded: “To improve the code, we can make it more modular, enhance readability, and follow best practices.” After explaining suggestions like “Use const wherever possible,” “Encapsulate related functionality,” and “Use arrow functions consistently,” it then proceeded to refactor the entire script, making it look (and probably work) much better than what I had hacked together.
This approach did not occur to me right away, even though I’ve been following the progress of ChatGPT for years now. My mind still went to places like Reddit or Stack Overflow, but I hesitated because I figured I’d be met with responses that either made too many assumptions and were overly technical or questioned why I was even doing this. With ChatGPT, I could ask it any question, no matter how small or how dumb, and it wouldn’t give me a snarky reply or challenge my motives. With AI as my co-pilot, I was able to get help with questions that I didn’t have any place else to ask. One thing this exercise has done for me (along with this Google Gemini demo) is foreshadow the not-too-distant future where bespoke software becomes the norm. I’m bullish on any business that leverages AI to help people answer questions they’re too nervous or embarrassed to ask other humans.
Next episode
Eventually, it might be fun to turn this project into a more sophisticated web app like Campfire. But for now, it does what I need it to do: play my favorite podcasts while I’m on the treadmill and the weight machines. And it’s mine. It can be yours too if you don’t mind getting your hands a little dirty in GitHub. You don’t need to worry about local builds. Just create a repository from my template, add your subs, and publish! An interesting side effect feature I hadn’t thought of is that when your podcast player is a public website, sharing your whole playlist with others is as easy as sharing a link.
If anyone’s interested, I can share the gory details of some of the challenges I ran into, like how to get jekyll-import to work with more than 1 feed (and get other content like the channel image), why the GitHub Actions deployment kept blowing up, and how to work around audio stopping after the phone is on the lock screen. In the meantime, head over to the Lowcode Lounge and check out Pod Force. Thanks for reading, and may the Force be with you. Always.