Sign inSign up

sagebind/websnip

By sagebind

•Updated almost 10 years ago

Self-hosted web service to save any web article as a clean PDF

Image
0

328

sagebind/websnip repository overview

⁠Websnip

Self-hosted web service that saves web articles to clean PDFs.

⁠Usage

The easiest way to run Websnip is as a Docker container. A prebuilt image is available in the Docker Hub as sagebind/websnip.

Websnip uses the [Mercury] API to extract an article's unstyled content before generating a PDF, so you will need to get your own Mercury API key. Once you have one, you can run Websnip with that key by setting the MERCURY_API_KEY environment variable:

docker run -d -e MERCURY_API_KEY=<API_KEY> -p 80:80 sagebind/websnip

Once Websnip is running, it will begin accepting GET requests on port 80. The query portion of the URL is the URL of the article to convert. For example, to download the article at http://words.steveklabnik.com/a-new-introduction-to-rust⁠ as a PDF, you can make a GET request like this:

curl "http://localhost:80?http://words.steveklabnik.com/a-new-introduction-to-rust" > a-new-introduction-to-rust.pdf

Tag summary

Content type

Image

Digest

Size

114.7 MB

Last updated

almost 10 years ago

docker pull sagebind/websnip