Kindle Highlights and Notes Plugin

I’d like a plugin that will sync my Kindle highlights and notes into Logseq without having to sign up for a new service like Readwise.

It looks like Amazon does not offer an API for this, so I suppose this would have to be done via a scraper of some sort.

I also noticed that there is an Obsidian plugin that appears to do this, so perhaps that could be a good starting point and could be adapted to Logseq? GitHub - hadynz/obsidian-kindle-plugin: Sync your Kindle notes and highlights directly into your Obsidian vault

I just got a plugin working that pulls Kindle highlights from the My Clippings.txt file. I submitted it to the marketplace this morning, but if you know how to manually load plugins the project is here: https://github.com/theBenForce/logseq-plugin-my-highlights

4 Likes

Just got the plugin published. It’s called “My Highlights” in the marketplace. Let me know if you see anything that needs improvement.

3 Likes

Thanks for making this!

Would it be possible to create a query that would give 3 random quotes per day similar to what Readwise does?

I’m new to Logseq and queries and haven’t found extensive documentation on how to create them.

Try this.

https://m.youtube.com/watch?v=pIEhIIZc2cw

1 Like

Thank you Aryan!

Two issues I see…

  1. Nothing comes up when I use the code <%randomblock [[highlights]]%> or <%randomblock highlights%> or any other tag I replace “highlights” with.

  2. Once I get the random block to work, I’m unsure how I will get the nested page blocks for each individual book.

The structure is highlights/book/NAME OF BOOK

All of the highlights are on the NAME OF BOOK page but I would like to get a random quote from all of the books not a specific one.

Maybe I could add an option to customize the format of the highlight blocks so you could add tags to them.

Would that work?

That could definitely be one solution.

I am just wondering if there is a way to query any blocks on a set of nested pages.

Like all blocks on subpages of highlights/book

theBenForce

I would definitely be interested in having the ability to customize the nesting structure.

You can edit the page name in the plugin settings if that’s what you mean.

1 Like

Thanks!

I changed the page name settings as follows…

{author}/{type}/{title}/highlights

Everything works except the {author} that shows up as {author} instead of inserting the author’s name

Author isn’t a currently supported variable, but I’ll see if I can add it.

Okay, I just released a new version. After you update you should be able to use {author} in your template.

I added a default_author setting too. This will be used when the highlights file doesn’t have an author available.

I couldn’t get it to work. Still have the {author} instead of the actual author.

I went back to the way you originally had it for now.

This is a fantastic plugin.

I have highlights on about 50 or so books and this is really useful.

Thank you.

Question:

What happens if I make notes on one of these highlight page blocks and then have more highlights on the book?

When it updates does it erase the notes I put on that page or does it add new highlights without affecting the notes I have added to previously added blocks?

It will only add new highlights. As long as the highlight ID block property is present it won’t re-import the highlight. So feel free to add formatting or whatever to the imported highlights :slight_smile:

1 Like

BTW: there is a bug that I’m working on where new highlights are added to the start of the document. You can find updates for it here: Add new highlights to the end · Issue #4 · theBenForce/logseq-plugin-my-highlights · GitHub

@theBenForce Had to remove all my highlights from my graph.

Something weird started happening.

When I opened a page with highlights it wouldn’t be the original imported page it would be a page with a backlink to the original.

Then when I would click on the original highlight page it would rename that page (and often quite a few others with another book name inserted into it).

I tried a few times to just delete the new additions, but the issue kept multiplying. So I just deleted all the imported highlights pages.

Not sure if it’s an issue with the pages that get imported or something else.

You plugin was already uninstalled when this happened (I had some other weird things happened and uninstalled all plugins).

But the highlights pages are the only pages that this has happened with.

Just wanted to give you a heads up on that.

Thank you for letting me know. Do you have one of the messed-up pages that you could share with me? I’ve opened an issue on GitHub you can see my progress on resolving this.

Also, what version of the plugin did you have installed?

I replied via email but not sure if you got it.

I don’t know which version I used. I started using it the day I first posted.

Let me know if you received the email with the attachment of the sample page.