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

api: add /feed API to get an Atom feed for an URI #419

Merged
merged 6 commits into from Apr 24, 2018

Conversation

Projects
None yet
2 participants
@vincentbernat
Contributor

vincentbernat commented Apr 21, 2018

We need absolute URL at some places. We assume the first host
configured is the base of the URI we have.

Fix #81.

This is mostly a "RFC". Notably, tests are missing.

vincentbernat added some commits Apr 21, 2018

api: add /feed API to get an Atom feed for an URI
We need absolute URL at some places. We assume the first host
configured is the base of the URI we have.

Fix #81
@vincentbernat

This comment has been minimized.

Contributor

vincentbernat commented Apr 22, 2018

Tests have been added. Caching should work properly and the client side too.

The only problem I see is the use of the first host defined in [general]. Maybe I should add an [rss] section instead an add a base parameter here instead?

'uri': uri,
'order_by': 'id',
'asc': 0,
'limit': 100

This comment has been minimized.

@blatinier

blatinier Apr 22, 2018

Collaborator

This could be an option in isso.conf

except ValueError:
return BadRequest("limit should be integer")
comments = self.comments.fetch(**args)
base = self.conf.get('host').split()[0]

This comment has been minimized.

@blatinier

blatinier Apr 22, 2018

Collaborator

I'd put this line in the init, something like:

self.main_host = self.conf.get('host').split()[0]  # or first_host

or

self.hosts = self.conf.get('host').split()  # and then select the first inside code

The parse(base).netloc too I would put it in the init

@blatinier

This comment has been minimized.

Collaborator

blatinier commented Apr 22, 2018

Just like you suggested, adding a section [rss] in the conf for the host & limit seems like a good way to fix my comments too.
Anyway thanks for you efforts, here and on other issues, I'll try to take some time to review, test and merge all that :)

feed: make /feed API call configurable server and client-side
On server-side, this can be enabled by providing a base URL to use to
build the full URL. Limit also becomes configurable. On client-side,
we need to add a switch to know whatever or not the additional link
can be displayed.
@vincentbernat

This comment has been minimized.

Contributor

vincentbernat commented Apr 22, 2018

I've added a commit to include some configuration on both server-side and client-side.

@vincentbernat

This comment has been minimized.

Contributor

vincentbernat commented Apr 23, 2018

Forgot to include HTML rendering. I've pushed another commit for that.

Ok for merging

@blatinier blatinier merged commit b5c40be into posativ:master Apr 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment