InoReader Plugin

Alright I think I’ve found a way to do this. API is a little confusing but this is what will need to be done.

  1. User needs to register their own application at Preferences->API Access->New Application. This will look like the following:

Here I just put the name to be Obsidian and set the platform to be Web. I don’t think this really matters but shrug.

Hit Enter and you should get a new app with its usage statistics, the App ID, the App key (aka app secret, don’t share this), and the platform.

The downside at this point is that it seems like you can only create one application on a Pro account. Free accounts cannot create apps or otherwise use the API in any way. Anything more than one app requires an enterprise account.

The good news is that the API limits per app are 1000 requests a day for the Tier 1 API, which is what we will be using a lot of, and 100 requests a day for the Tier 2 API.

  1. Once we have this info we can then craft a GET request like so: https://www.inoreader.com/reader/api/0/stream/contents/user/-/state/com.google/annotated?AppId=*redacted*&AppKey=*redacted*&annotations=1&n=1000

This will get us a list of all articles using the user/-/state/com.google/annotated stream, which contains a list of all annotated articles, will get the annotations itself with the annotations=1 or annotations=True setting, and get the max number of them per query, aka 1000.

  1. Check to see if the JSON response contains a “continuation” field. If so we grab this value and then send the same request but with this appended to the end so it will look like https://www.inoreader.com/reader/api/0/stream/contents/user/-/state/com.google/annotated?AppId=*redacted*&AppKey=*redacted*&annotations=1&n=1000&c=aOfeKJL2Fr_9 if “continuation” field had a value of “aOfeKJL2Fr_9”

  2. From here we can probably use some JSON parser to get all of the “annotations” fields and then get the “text” field to get the highlighted text, and the “note” field to get the contents of the note. An important note here is that notes can exist without highlights, and highlights can exist without notes. So these fields are independent of one another and can one can exist without the other.

Notes:

  • This is likely not the best way to authenticate as anyone monitoring traffic will see the secrets in the URL which is not protected data. I’m just showing this here as a proof of concept. We could likely work on the idea of using this to demonstrate the concept and then rework the authentication code to actually use proper OAuth2.0 authentication, but I’m not familiar with OAuth 2.0 or much of JavaScript (I’m mostly a Ruby programmer by trade) that may add some overhead if we start off from there. I do think its an important task to do though.
1 Like