I used Open Library to supply my cover images and a few bibliographic details of the books here. Unfortunately as you may notice when looking at the book lists, the cover images aren’t available. That’s because, at least as of right now, Open Library is down as part of the Internet Archive hack and the response.

A few weeks before the archive went offline, I happened to be in the process of redesigning this site as a static site generated from a Sqlite database. I wanted to make a utility to update details from Open Library on demand for existing books, or whenever adding a new book. The current setup is a messy Ruby script tangled up with the site generation code. I wanted to make something easier to maintain and run, so I chose Go.

As a first step, I made a small Go-lang program to download cover images for all books in my database. This worked great – it was mid-September when I ran it. It captured all available cover images for my books.

Then, the other day, I went to add integration with the Open Library API to update images for new books and get other book details. It was unavailable. It’s been over a week now and no word on when Open Library will come back, if ever. This site uses links to the cover images, unfortunately. My new site will store all assets locally and won’t be subject to third-party API outages. I’ve already got most images.

API Alternatives

I’m focused on automating as much of the book addition process as possible.

My plan is to switch to Google Books API to fill in basic details and cover images. The utility will do a search based on author and title and offer the top results, and the user can accept one of the results if they match.

I revisited Goodreads and found they’ve discontinued their developer API unfortunately. I’d still like to put a link to a book’s Goodreads page, but I’m not certain how feasible it will be to programmatically determine the URL without an API to help search by author + title or ISBN. I suppose I could do it partly by hand.

To acquire a nice Amazon link with a search requires membership in the affiliate program. Otherwise you can paste in links you come up with by hand.

During the search for Open Library API alternatives I stumbled on Hardcover. They have an API (GraphQL) API that’s in flux but seems reasonably easy to use. Also it’s just a really nice Amazon-free book reading and review site!

Building a new site

While looking for an excuse to learn Go-lang and web development in Go I decided to redesign this site. My plan was to port over all the Open Library integration, but that seems unlikely to work out.

Anyway, I wanted to try some different design at the same time: Here’s a preview listing all books – the actual site will group books by ratings and use some pagination. I am considering making it a dynamic application too, perhaps with a little HTMX for the front end.

The app has an Sqlite database modeled with Gorm in Go (maybe overkill but an excuse to try out Gorm.) It generates static pages and has a crude interactive “New Book” mode.

So far Go has been a nice experience. You just get stuff done. Its JSON parsing and deserialization feels pretty good, database integration pretty nice and HTML templating makes sense. Compile times are fantastic and the IDE integration is just fine. The worst part by far is working out why a program breaks when processing a template. This mostly just takes practice to avoid beginner mistakes.