Open nycterent opened 3 years ago
Hi there, I know the basics of Django and would like to contribute to this idea. Can you guide me on how should I proceed? :)
I don't have a clear idea going in of what this should look like, but I'd be happy to suss it out together!
When we talk about syncing data between apps, there are two fairly different things involved - copying data from bookwyrm to readwise, and copying data from readwise to bookwyrm. Off the top of my head, I think it would entail something like this:
In this use case, someone posts a quote on bookwyrm and that quote is sent to their readwise account. It looks like they use title and author to determine the book, which will be straightforward to provide.
Highlight CREATE
)
POST
to readwise with the json blob, and then readwise can sort out the restHighlights LIST
)
book_id
field with each highlight, which will have to be looked up since it won't mean anything to BookWyrm on it's own. I didn't see how to do this in the API documentation.text
field provided in the API response - but it will need to check if that highlight has already been created so that they aren't re-imported every time a sync happensBookWyrm to Readwise (this is not simple, but sounds doable)
Readwise is mostly highlight resurfacing service, so if this part: BookWyrm to Readwise would be implemented - that would be awesome. Afaik deleting is not important use case as you can do it in readwise and it is part of using Readwise flow.
On Sat, Feb 12, 2022 at 19:30:36, Mouse Reeve @.***> wrote:
I don't have a clear idea going in of what this should look like, but I'd be happy to suss it out together!
When we talk about syncing data between apps, there are two fairly different things involved - copying data from bookwyrm to readwise, and copying data from readwise to bookwyrm. Off the top of my head, I think it would entail something like this: BookWyrm to Readwise (this is not simple, but sounds doable)
In this use case, someone posts a quote on bookwyrm and that quote is sent to their readwise account. It looks like they use title and author to determine the book, which will be straightforward to provide.
Let bookwyrm users add a Readwise authentication token to their account
- This probably makes sense to add to the user model, and include in the user settings views
Send BookWyrm data to readwise when a quote is created (https:// readwise.io/api_deets https://readwise.io/api_deets, Highlight CREATE )
- If the user has a Readwise integration, create a celery background task to update readwise when a quote is created
- In the celery task, generate a json blob in their expected format
- Send an http POST to readwise with the json blob, and then readwise can sort out the rest
Delete or update readwise highlights when the bookwyrm quote is deleted or updated
Readwise to BookWyrm (this is a lot harder)
Authenticate Readwise (same as 1 above)
Fetch readwise data about a book (https://readwise.io/api_deets Highlights LIST)
- It doesn't appear that Readwise will proactively send data when a highlight is created, so this will have to happen periodically, or when a user manually triggers a sync
Interpret the readwise data and create a BookWyrm status from it
- Readwise will provide a book_id field with each highlight, which will have to be looked up since it won't mean anything to BookWyrm on it's own. I didn't see how to do this in the API documentation.
- Once a usable book identifier is acquired (like an ISBN or title and author), it will need to be matched with a book in the instance database. If the book isn't present or can't be found, it's not clear what should happen.
- If a book is found, a quote can be created from the text field provided in the API response - but it will need to check if that highlight has already been created so that they aren't re-imported every time a sync happens
— Reply to this email directly, view it on GitHub https://github.com/bookwyrm-social/bookwyrm/issues/1603#issuecomment-1037333404, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATZ3MGKNEREXMONT6TAZ3U22KLZANCNFSM5H6Q4ETA . You are receiving this because you authored the thread.Message ID: @.***>
Thank you -- I think implementing just posting from bookwyrm to readwise would be very achievable and I'm glad to hear that that sounds like a useful piece! There's still a lot of unknowns for me about how well it would work, since I haven't used Readwise, but I'd be happy to support if taking on that chunk of what I mentioned above sounds good, @ozer550
i have a finished code for this do you want ?
yes! definitely
ok in the code you just need the api key do you have it?
of course you have lol
It would be nice to be able to sync highlights/notes from Readwise to Bookwyrm and back.
https://readwise.io/
They have an API that could be used for this feature.