InoReader Plugin

Thinking of perhaps creating a plugin to grab annotations from InoReader using their API. Right now its possible to get a JSON object using something like the following request:

https://www.inoreader.com/reader/api/0/stream/contents/user/-/state/com.google/annotated?annotations=1&n=1000&output=json&AppId=redacted app ID&AppKey=redacted App Key

This would first grab the stream of all of your annotations, 1000 per request, requesting annotation details (hence the annotations=1 part), as a JSON object, and then according to Developer Portal: Authentication & API Methods | Inoreader - Stream contents, we would be able to use the Continuation field to add a “c” parameter that would be able to continue the request and grab the next 1000 items and so on and so forth until no “continuation” field is returned.

Whilst the basic premise here is that one could dump their InoReader annotations into Obsidian (since there is no way to export annotations right now as a button or similar within InoReader that I am aware of), the reality is we could get more creative than this and use different Stream IDs, as noted at Developer Portal: Authentication & API Methods | Inoreader - Stream IDs, to get annotations only for specific tags, only for read articles, or other specific criteria (with some limitations).

The main problem likely will be trying to do this properly with OAuth2 from what I can see since I haven’t worked with that before, but assuming that all works then the next part would mostly just be parsing the JSON output correctly to ensure we are grabbing all the entries and then saving the annotations appropriately. JSON doesn’t look to be too complicated so I imagine this wouldn’t take a long time to figure out.

Would be curious to know if this would assist anyone; I couldn’t find anything similar for InoReader when I was searching around so thought I’d post this here to gauge interest and see if people are working on anything similar.

3 Likes

Hi @tekwizz123, I just get here from a Google Search looking to see if there is any existing integration already. I’m Inoreader Pro user and would definitely welcome any integration with Obsidian :slight_smile:

5 Likes

Hi,
+1 for me.
Any solution that integrates my findings in inoreader to obsidian is appreciated. By annotations, star or tag.

3 Likes

I have a workaround to get the starred articles from Inoreader to Obsidian. Maybe you can adopt it for annotations.
Steps needed:

  • Create an rss feed from your starred articles in inoreader:

image

  • Install obsidian-rss Community plugin
  • Subscribe to this feed in obsidian-rss plugin

1 Like

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

@limex Thanks for sharing that stream link in your image though that was the piece of info I needed to get things to click on how to implement this :slight_smile:

1 Like