-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API #192
Comments
I did, but only barely, because it sounds like a lot of work :) If I actually had time to do it, I'd like to have GraphQL API, or a "proper" RESTful API (as described here) that's also OpenAPI-compatible. For the web app I was a bit more pragmatic and I made a very limited JSON API, but I am reluctant to expose it both because it's very limited, and because I have some "special" requirements (I need it to work both with JSON and with old-style HTML forms). I am interested, but I currently don't have enough bandwidth to maintain it. If you are willing to do it, we can include it in reader as an extra, or it can live as a separate package. Once there is a proof of concept, I can add chunked/paginated versions of the methods that return iterables (e.g. get_feeds, get_entries); I held back on this because I didn't really have a use case until now. Thank you for your interest! |
Thanks for the link! I will start with the simplest thing I can get to work, I'm a beginner with this so don't expect to much. If I have something useable I will post here to let you know and you can think about using it. Being able to pass an offset and a limit as url parameters would be very useful for me I don't know what else, I will have to experiment a bit :) |
No worries! :) Again, thank you!
The current implementation (not exposed in the public API) uses scrolling window queries instead of limit+offset, for performance reasons. So, where a limit+offset API would look something like: get_page_of_things(..., limit=20, offset=0*20) -> [1, 2, ...]
get_page_of_things(..., limit=20, offset=1*20) -> [21, 22, ...] ... the reader API will look like: get_page_of_things(..., limit=20, next=None) -> ([1, 2, ...], 'next blob')
get_page_of_things(..., limit=20, next='next blob') -> ([21, 22, ...], 'another next blob') where This has the downside of not being able to go to the nth page directly, but this functionality can be added later if needed. |
Thanks for your help, I don't think I would have a need to go to the nth page so this should work nice for my purposes. Currently I'm drawn into creating a generic tree UI builder for Emacs after which I plan to use it to implement the feed reader UI so it will take a while until I 'm able to start working on this. I will probably try to model the API similar to the miniflux API. |
Hi @clemera, pagination is finished now, and should be released in 1.12 in the following days. You can find a short description of how it works here: https://reader.readthedocs.io/en/latest/guide.html#pagination |
Thanks for the notification! It currently busy with other projects but I'm still interested in this! |
I continue to not have enough bandwidth to implement/maintain a REST API, so I'm closing this for now. If anyone wants to take on this work, or is willing to pay for it (I can offer commercial support), please re-open the issue. Thank you! |
Have you thought about providing a REST API returning feed data as JSON? This would help implementing other UI interfaces. I will probably experiment with that and if your are interested provide a PR.
The text was updated successfully, but these errors were encountered: