💾 Archived View for gemini.rlamacraft.uk › techGuides › movingOffGoodreads.gmi captured on 2024-06-16 at 12:36:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

Moving off of Goodreads

In my quest to migrate off of over-engineered big-tech solutions to trivial problems I have just downloaded the list I maintained on Goodreads of interesting books to one day, maybe, get around to reading. Instead, I now use a recfile[1], allowing me to trivially search by tags when looking for a new book.

[1] :: GNU.org :: Recutils

Goodreads provides an export as CSV option (yay!) from which I was able to hack together the following AWK script for pulling out the book title, author, date added to the list, and bookshelves (which I use as tags) and then printing them in a recfile format. With a little bit of preamble, this just works.

awk -v FPAT='[^,]*|"[^"]+"' 'BEGIN{
  print "# -*- mode: rec -*-";
  print "";
  print "%rec: To Read";
  print "";
}
/to-read/ {
  gsub("\"","",$2);
  print "Name: " $2;
  print "Author: " $3;
  print "Date: " $16;
  gsub("\"","",$17);
  print "Tags: " substr($17,10);
  print "";
}' $FILE

GitHub Gist

For more explanation on the FPAT variable when parsing CSV, take a look at the StackOverflow post[2] and the GNU docs[3] that helped me figure that out.

[2] :: StackOverflow :: What's the most robust way to efficiently parse CSV using AWK?

[3] :: GNU.org :: GAWK :: Splitting By Content

~~~

Last Updated: 2021-01-03

..