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

Allow usage via API #43

Closed
zakius opened this issue Sep 3, 2021 · 5 comments
Closed

Allow usage via API #43

zakius opened this issue Sep 3, 2021 · 5 comments

Comments

@zakius
Copy link

zakius commented Sep 3, 2021

Thanks for your great tool! It would be great if it was possible to use it in more automated way thanks to some simple API, the most basic idea would be receiving the feed name and returning the generated id, though returning an object containing mail address and feed address may be preferred. I may even implement this if you are willing to accept such a feature

@leafac
Copy link
Owner

leafac commented Sep 13, 2021

Thanks for the idea. I actually like it. I’ll take it on myself as part of some changes I already want to make. I’ll let you know when it’s read.

@zakius
Copy link
Author

zakius commented Sep 13, 2021

Thank you, I'll be looking forward to it!

@leafac
Copy link
Owner

leafac commented Jun 6, 2024

Hi @zakius,

I implemented this and it’ll be out on the next version of Kill the Newsletter!

The only routes that I found made sense as an API are the create feed and delete feed routes.

The delete feed route already acts like an API, you can just ignore the HTML that it returns.

For the create feed route I added a way for you to send a request header of Accept: application/json and the server responds with JSON instead of the usual HTML, for example:

$ curl --request POST --header "CSRF-Protection: true" --header "Accept: application/json" --data "title=Example of a feed" https://localhost/
{"feedId":"r4n7siivh4iiho0gtv59","email":"r4n7siivh4iiho0gtv59@localhost","feed":"https://localhost/feeds/r4n7siivh4iiho0gtv59.xml"}

I’m curious to know what you end up creating with this.

Best.

@leafac leafac closed this as completed Jun 6, 2024
@zakius
Copy link
Author

zakius commented Jun 6, 2024

Thanks! If you don't mind I'd like to use it in a browser extension that simplifies feed detection and subscription, I'm not entirely sure whether I'll submit it to extension repositories as it's meant mainly to integrate with my self hosted aggregating service but it will surely end up on GitHub some day

@leafac
Copy link
Owner

leafac commented Jun 6, 2024

Sounds great!

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

No branches or pull requests

2 participants