Skip to content
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

@vincentbernat
Copy link
Contributor

@vincentbernat 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 vincentbernat force-pushed the vincentbernat:feature/atom-feed branch 6 times, most recently from acf81ec to 72a2ccc 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
@vincentbernat vincentbernat force-pushed the vincentbernat:feature/atom-feed branch from 72a2ccc to 7650465 Apr 22, 2018
@vincentbernat
Copy link
Contributor Author

@vincentbernat 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?

@vincentbernat vincentbernat force-pushed the vincentbernat:feature/atom-feed branch from 7650465 to bceb695 Apr 22, 2018
'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
Copy link
Collaborator

@blatinier 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 :)

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
Copy link
Contributor Author

@vincentbernat vincentbernat commented Apr 22, 2018

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

@vincentbernat
Copy link
Contributor Author

@vincentbernat vincentbernat commented Apr 23, 2018

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

@vincentbernat vincentbernat force-pushed the vincentbernat:feature/atom-feed branch from a6709ba to 01cf96e Apr 23, 2018
@blatinier blatinier dismissed their stale review Apr 24, 2018

Ok for merging

@blatinier blatinier merged commit b5c40be into posativ:master Apr 24, 2018
1 check passed
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.