Y2Z / monolith

⬛️ CLI tool for saving complete web pages as a single HTML file
https://crates.io/crates/monolith
Creative Commons Zero v1.0 Universal
11.17k stars 314 forks source link

API for monolith #20

Open karanchawla opened 5 years ago

karanchawla commented 5 years ago

Is it possible to create an API endpoint where you send the website link to the endpoint and it returns the html page so that you can save this on the server?

For example: [GET] domain.monolith.com/savepage?link=www.targetwebsite.com

If there is interest in this, I would love to contribute.

snshn commented 5 years ago

This could be done relatively easy with any web server, although perhaps monolith could be enhanced to be a Rust crate itself (aside from its CLI interface), letting other Rust programs pull monolithic web pages directly, if needed.

cbluth commented 5 years ago

@karanchawla

if you read the html of my tool, then you can deconstruct the post request, then you would be able to do something like this: curl -X POST and parse the output.

i could make a real api that outputs json, that wouldnt be too much more work.

here is a link to my tool: https://dweb.tools/pagesaver