Migrating from Goodreads

2020-12-02

For the past few years I’ve been using Goodreads to track my reading habits. I use it to keep track of my reading queue and to log what I’ve read. Goodreads does a ton of things; there are discussions, reviews, recommendations, and probably dozens of other features. However I (and I suspect the majority of users) use only a very small percentage of its features. For me I only interact with my “to read” and “read” lists.

I figure I might as well move my data out of Goodreads into something more within my control. One less service to worry about.

My reading library is now hosted on my website at: https://hbenjamin.com/library/


For posterity, here are the steps I took.

First I exported my Goodreads data. This gives me a CSV file containing the books I’ve read.

I wrote a small script that takes the CSV rows and transforms them into structs that I’ll use for rendering the page. The output (TOML) looks like:

[[read]]
  author = "Nicholas Eames"
  read_at = "2019-01-15"
  series = "The Band"
  series_volume = "2"
  title = "Bloody Rose"

[[read]]
  author = "Madeline Miller"
  read_at = "2019-01-20"
  title = "Circe"

[[read]]
  read_at = "2019-01-26"
  author = "Sebastien de Castell"
  series = "Greatcoats"
  series_volume = "1"
  title = "Traitor's Blade"

The data, like the rest of my website, is version controlled using Git and hosted on GitHub.

I use Hugo for my website, so then it’s just a matter of rendering this data into a table. Here’s what it looks like, tweaked for brevity.

<table>
  <thead>
    <tr>
      <th></th>
      <th><strong>Title</strong></th>
      <th><strong>Author</strong></th>
      <th><strong>Date read</strong></th>
    </tr>
  </thead>
  <tbody>
  {{ range $index, $element := sort $.Site.Data.library.read "read_at" "desc" }}
    <tr>
      <td>{{ add $index 1 }}</td>
      <td>{{ .title }}</td>
      <td>{{ .author }}</td>
      <td>{{ .read_at }}</td>
    </tr>
  {{ end }}
  </tbody>
</table>