Comments (5)
For documentation, this issue was implemented in this commit: 943f91a
from readwise-mirror.
Hi @tdnzr , I just investigated this for you and it appears that it's looking like answer A.
As you guessed, it appears that this particular field is not exposed by the APIs used in this plugin. It looks like the field you're looking for is readwise_url
; however, that field is only exposed on the Export
API which sends the entire Readwise library (which is how other plugins, such as Notion's work).
However, this plugin uses Readwise's "Advanced" API in order to only sync updated data and fetch newly updated items, and this endpoint contains different fields. This is an example of what highlights
API returns:
{
"id": 13,
"text": "To be alone for any length of time is to shed an outer skin. The...",
"note": "",
"location": 57,
"location_type": "location",
"highlighted_at": "2020-02-02T16:46:07Z",
"url": null,
"color": "yellow",
"updated": "2020-04-06T12:30:52.318552Z",
"book_id": 1337,
"tags": []
}
You can check out Readwise's API documentation here: https://readwise.io/api_deets
from readwise-mirror.
(EDIT: This reply is obsolete, see my next comment.)
-
Thanks for the links to the Readwise API documentation. I think you're right that the Advanced API doesn't provide what I want, but I don't think the
readwise_url
field is what I want, because it doesn't actually link to the aforementioned URLhttps://read.readwise.io/read/some_string
. The closest guess I have for what I actually want is thatsome_string
might be the same as theexternal_id
field exposed in the Export API. -
That said, in your example above, what is the "
url
" field in the highlights API? Its value isnull
in your example, and the field isn't even mentioned in your readme, but is its value ever notnull
? Maybe if one makes highlights in Readwise Reader, this might be the Reader URLhttps://read.readwise.io/read/some_string
? -
Finally, the API docs mention that one can use the Export API for syncing updated data, i.e. without fetching the entire library each time, by providing extra parameters:
Parameters:
updatedAfter
– (Optional, Formatted as ISO 8601 date) Fetch only highlights updated after this date.ids
– (Optional) Comma-separated list ofuser_book_ids
, returns all highlights for these books only.pageCursor
– (Optional) A string returned by a previous request to this endpoint. Use it to get the next page of books/highlights if there are too many for one request.The recommended way to use this endpoint is to first sync all of a user's historical data by passing no parameters on the first request, then pageCursor until there are no pages left. Then later, if you want to pull newly updated highlights, just pass updatedAfter as the time you last pulled data. This is shown in the examples on the right.
from readwise-mirror.
Hey there, I've asked on Discord, and supposedly the url
endpoint is indeed the thing I care about. So this issue can indeed be implemented in Readwise Mirror.
Quoting from Discord here
My question:
In the Readwise export API, is there an equivalent to the field "highlight_location_url", which is used by the official Readwise export plugins to display the "View Highlight" (= in Reader) URL (https://read.readwise.io/read/some_string )? Having browsed the Readwise API at https://readwise.io/api_deets, I can't find such an equivalent. My best guess is that possibly, the external_id field might be equivalent to some_string in the aforementioned Reader URL.
Answer:
It's the highlight_url in the Highlight CREATE endpoint, which is the "[u]nique url of the specific highlight (eg. a concrete tweet or a podcast snippet)".
If you're looking for the corresponding key in the response, it's "url": in the Highlights LIST endpoint and a few others.
And after asking for more clarification:
The "
highlights_url
": response (with an "s") is the link to the article/book/… in Readwise, similar to "readwise_url
" in some other endpoints, such asHighlight EXPORT
. I don't know why both exist, maybe it's a legacy thing [...], but I think it's fair to say that "highlights_url
": = "readwise_url
", depending on endpoint
The unique URL of a highlight will always be shown after "url
": in the response (e.g., in theHighlights LIST
orHighlight DETAIL
endpoints)
These unique URL responses are often "null" and only exist for highlights that can have a unique URL, like tweets, podcast snippets, saved discord comments, or any highlight created in Reader. So yes, any highlight made in Reader will have thehttps://read.readwise.io/read/highlightID
in the response after "url:
"
from readwise-mirror.
As you can see above, I've tried to make pull requests based on the info from Discord. Once again apologies for making single-file pull requests.
from readwise-mirror.
Related Issues (20)
- Add feature to sort highlights by page location, instead of timestamp HOT 1
- Templating engine
- Metadata sync HOT 1
- Ability to customize file name
- Edit already existed highlights HOT 1
- How does this compare to the readwise official now that it is out? HOT 1
- Filter out highlights that have been discarded in Readwise
- Modification request HOT 2
- Partial note sections HOT 2
- FR: Ability to slugify file names and remove emojis HOT 3
- Bug? Highlight Template does not export tags by default HOT 3
- Bug: Readwise Mirror generates a locationUrl even for non-books HOT 1
- Are these comments needed for the plugin to operate correctly? HOT 1
- Rate-limit requests when there are issues getting timeout length HOT 3
- Fix Filename Too Long Error
- Ability to include document notes and summaries in export HOT 6
- Location HOT 2
- Google Play Books links point to Kindle app HOT 1
- Format for highlights is substantially different from the Readwise manual markdown export HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from readwise-mirror.