Like many techies on their day off, I completely abandoned my planned tasks and embarked on an entirely unplanned project: creating a macOS application. Well, to be more precise, I decided to prompt one using Claude 3.5 Sonnet .
With Anthropic’s recent updates to their AI model, I figured it was the perfect opportunity to test its capabilities while solving a personal need.
The Catalyst: My New Tuneshine Device
Recently, I acquired a Tuneshine - a clever device that arrived last week. It works wonderfully with my streaming services of choice, including Apple Music and Spotify , and offers integration with LastFM .
For those unfamiliar with the device, Techmoan provides an excellent overview in their review:
For those that know me, you will know that the Tuneshine ticks a lot of geeky boxes ✅.
The Challenge
Given the Tuneshine’s LastFM support, I assumed I could continue using OpenScrobbler to log my vinyl listening sessions and have the album artwork display on the device. I was mistaken - but not due to any fault in either the Tuneshine or OpenScrobbler.
The issue lies in how these services interact with LastFM. The Tuneshine is designed for online players and monitors tracks that are “Scrobbling now” through LastFM’s API. In contrast, OpenScrobbler manually logs tracks after they’ve been played, which means they don’t trigger the “now playing” status that the Tuneshine looks for.
After searching for an alternative - specifically, an application that would run in the background and send real-time “now playing” requests to the LastFM API - I came up empty-handed. That’s when I decided to prompt my own solution.
Where to start?
The place to start was prompting a quick MVP, could I get Clade to give me something that
Claude returned the following code (I filled in the track details at the bottom):
|
|
After installing the pylast module using the command below:
pip install pylast
I ran the code and saw that “God” by Tori Amos from the album Under The Pink had appeared in LastFM and glancing over at the Tuneshine I saw the following …
Result !!! Now that I proved it could work I could start prompting away.
Prompting the full application
I won’t fill this post with every prompt, because there were a lot of them, but after a few hours I had a Python powered stand-alone macOS application. The key fetaures I prompted were …
- Search albums using their Discogs ID
- Automatic track duration detection (with fallback options)
- Real-time “Now Playing” status with a timer
- Automatic track progression
- Clean configuration management as I didn’t want to hard code any of my keys or credentials into the application
- Detailed logging system
Its uses the rumps to do the bulk of heavy lifting around being a status bar application and then py2app to take the rumps powered status bar application and make it standalone,
Seeing it in action
It is a really basic application so lets dive straight in scrobble Damned Damned Damned by The Damned - first off we need the Discogs ID which is “24589202”. Now we have that we can open the application and search for it:
Checking the logs at ~/.vinyl-scrobbler/vinyl_scrobbler.log
I can see the following:
tail -f ~/.vinyl-scrobbler/vinyl_scrobbler.log
2024-10-28 16:45:46,156 - INFO - No Discogs duration for I Feel Alright, trying Last.fm...
2024-10-28 16:45:46,156 - INFO - Fetching duration from Last.fm for: The Damned - I Feel Alright
2024-10-28 16:45:46,156 - INFO - track.getInfo
2024-10-28 16:45:46,570 - INFO - HTTP Request: POST https://ws.audioscrobbler.com/2.0/ "HTTP/1.1 200 OK"
2024-10-28 16:45:46,573 - INFO - Found duration on Last.fm: 4:27
2024-10-28 16:45:46,573 - INFO - Menu updated successfully
2024-10-28 16:46:04,573 - INFO - Loaded album: Damned Damned Damned
2024-10-28 16:46:54,528 - INFO - track.updateNowPlaying
2024-10-28 16:46:54,773 - INFO - HTTP Request: POST https://ws.audioscrobbler.com/2.0/ "HTTP/1.1 200 OK"
2024-10-28 16:46:54,774 - INFO - Updated now playing: The Damned - Neat Neat Neat
2024-10-28 16:49:36,780 - INFO - track.scrobble
2024-10-28 16:49:36,941 - INFO - HTTP Request: POST https://ws.audioscrobbler.com/2.0/ "HTTP/1.1 200 OK"
2024-10-28 16:49:36,943 - INFO - Scrobbled: The Damned - Neat Neat Neat
2024-10-28 16:49:36,944 - INFO - track.updateNowPlaying
2024-10-28 16:49:37,093 - INFO - HTTP Request: POST https://ws.audioscrobbler.com/2.0/ "HTTP/1.1 200 OK"
2024-10-28 16:49:37,095 - INFO - Updated now playing: The Damned - Fan Club
Finally, checking the Tuneshine we can see:
Summary
What started as an off the cuff idea after waking up turned into a successful experiment in AI-assisted development using Claude 3.5 Sonnet. The challenge was to create a solution that would enable real-time LastFM scrobbling for vinyl records to work with the Tuneshine device. Through iterative prompting and development, I was were able to create a functional macOS status bar application that not only solves the original problem but includes several useful features.
The project demonstrates the potential of modern AI tools in practical application development. By leveraging Claude 3.5 Sonnet’s capabilities alongside libraries like rumps and py2app, I were was to transform a simple Python script into a fully-functional macOS application with next to no knowlege of either developing Python or native macOS applications.
For those interested in trying it out or building upon this project, the complete source code is available on GitHub at:
Contribute to russmckendrick/vinyl-scrobbler development by creating an account on GitHub.
Now its not perfect, so I should probably add the following:
Warning
Build and use this app at your own risk, it was developed by AI and I am on the only one who will probably ever want to use it 😊
But this adhoc project served as an example of how AI can be effectively used to rapidly prototype and develop solutions for specific use cases, even when working with multiple APIs and system-level integration requirements.
Audio Summary
Please note
The following audio summary of this blog post was generated by NotebookLM .