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

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 feature/atom-feed branch 6 times, most recently from acf81ec to 72a2ccc Compare April 22, 2018 11:05
@vincentbernat
Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

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

@vincentbernat
Copy link
Contributor Author

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

@blatinier blatinier dismissed their stale review April 24, 2018 19:56

Ok for merging

@blatinier blatinier merged commit b5c40be into isso-comments:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants