Atelier Clockwork

iTunes Image Downloader 0.1.0

Limiting Scope Sure Makes Finishing Side Projects Easier

Back in January I started fiddling with making a Swift library that could interact with the iTunes search API. I hit some snags on the project, primarily having to do with not all of the fields that the API returns having documentation, so that side project got shelved when real life got busy, then getting back in and finishing it wasn’t a high priority.

The over the weekend I used my old workflow to get iTunes cover artwork for something and the page redirected to the iTunes app. This meant I could either fight with figuring out how to disable the new default behavior to redirect to iTunes whenever possible, or suck it up and finish out my old project.

Given a concrete use case however, I cut the scope mercilessly. I scaled back to the two media types I was most likely to want with a plan to add more later. I also hard coded the search scope per media type, the return fields per media type, and so forth.

Since I stripped it down to CLI only at the moment, my error reporting involves lots of guard statements that print the error to the command line. To further simplify things, the command line parser only takes commands in a specific order. The final stripping of functionality is that the app just uses curl to download the image.

For anyone who’s interested the code is already up on github. I now have a plan for several weeks of technical blog posts to dig into from what I’ve learned and how I want to make the code better.