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

Suggestion: Add a public REST API that amputates links #12

Closed
Sv443 opened this issue Aug 27, 2021 · 2 comments
Closed

Suggestion: Add a public REST API that amputates links #12

Sv443 opened this issue Aug 27, 2021 · 2 comments

Comments

@Sv443
Copy link

Sv443 commented Aug 27, 2021

I'd love to be able to use your amputation in my own projects, so it would be really cool if there was a REST API that takes a URL and amputates it.
I know this is a lot to ask and I would offer my help but I don't know Python at all, so I'm just throwing this suggestion out here in case you or anyone else would like to implement it.

Example:

GET to https://amputatorbot.com/api/?url=https%3A%2F%2Fgoogle.com%2Famp%2Fs%2Ffoo.com%2Fbar

would return something like:

{
	"error": false,
	"url": "https://foo.com/bar"
}
@KilledMufasa
Copy link
Owner

Hi there! Thank you for the wonderful suggestion! After having received more requests like yours, I've decided to just go ahead and make one! You can find the entire announcement here. Or jump directly into the docs: API Documentation & Postman.

I'll just go ahead and paste the announcement post here too:

(...)
afbeelding
The most interesting data that gets returned (for this request) is - of course - the canonical:

"canonical": { 
    "domain": "electrek",
     "is_alt": false,
     "is_amp": false,
     "is_cached": null,
     "is_valid": true,
     "type": "REL",
     "url": "https://electrek.co/2018/06/19/tesla-model-3-assembly-line-inside-tent-elon-musk/",
     "url_similarity": 0.8900523560209425
 }
  • I dig it.

I've decided to open up this API to the public for free and without authentication, because hell, why not? It makes it easier for you guys to work with and for me to maintain. Worst case scenario is that people DDoS the shit out of our API, and to those I say, .. pls- just don't lol (I do got some things in place to keep stuff from going bananas of course, we'll just have to see how it goes).

I would love to hear about the projects you make with the API, feel free to comment or post about it on r/AmputatorBot!


Thx again for your suggestion! Without your issue, I probably wouldn't have made this. Let me know if the API is to your liking! Cheers!

@Sv443
Copy link
Author

Sv443 commented Nov 9, 2021

Thank you very much!
I was thinking of making a userscript that automatically amputates any URL it finds, I'll make sure to try the API out soon.

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