Josh

Bringing my media log highlights into my journal app

Importing Readwise into Day One

I’ve returned to using Readwise to record snippets of the books I’m reading at home (through their mobile app) and the articles I’m reading online (through their new Reader app).

In previous years, I’ve just recorded highlights and snippets of articles in my journal - written in Day One - alongside other general journal notes. I’ve got a couple years of those notes (though they are sparser than what I’ve been recording in Readwise these days), and I really enjoy looking back at what I was reading in previous years (like a Media Log), so I wanted to bring these Readwise highlights into my Day One journal.

Luckily, Readwise has a good API and pre-configured data export options. I was drawn to the API, but the markdown exporter already offered most of what I wanted: grouping highlights by source, auto-tagging, image embedding, etc. It will download a folder named Readwise with sections for Books and Articles. So I decided to start there.

Luckily, Day One has a [rudimentary] command line interface that I could write a [rudimentary] Ruby script around:

# Change this to your preferred journal
journal = 'Media Log'

command = "dayone2 -j '#{journal}' new"

# This assumes you have downloaded your Readwise highlights
# exported as markdown into a folder named 'Readwise'.
files = Dir["Readwise/*/*.md"]

files.each do |filename|
  IO.popen(command, 'r+') do |cmd_io|
    file = File.open(filename)
    cmd_io.puts file.read
    cmd_io.close
  end
end

You can save this into a file in the same directory where you have downloaded the markdown export and execute as ruby file.rb or you can just open up an interactive session via irb and paste in the code.

Now I have a reminder every weekend to download highlights from the week and run this script.

But this integration isn’t exactly what I would like - all the highilights are dated for the time of the import and it takes a bit of time to remember this and run the script.  So next week I’ll be experimenting with the Readwise API and the IFTTT Day One service (the closest thing I’ve found to a Day One API). I think I could get something running that would create journal entries on the fly (as highlights become available in Readwise).

www.joshbeckman.org/blog/importing-readwise-into-day-one