Skip to content

SmilyOrg/website-image-proxy

Repository files navigation

Website Image Proxy

The Website Image Proxy is a simple service that tries to provide an up-to-date screenshot of a website. This is useful for displaying websites on low-power IoT devices like the Inkplate, where running a full web browser is not feasible.

header image

It will always serve the latest available screenshot immediately without waiting. The neat trick it does is that it expects to be called on a regular interval, so it learns this interval and updates the screenshot just before each call is made. In practice, it means that the screenshots are always fresh (less than a minute out of date) without the need for manual synchronization or configuration.

Usage

Docker (recommended)

This is the easiest way as it includes all the dependencies needed already. Tested on a Windows 10 PC (Docker for Desktop) and Synology DS418play.

  1. Build and run the server via docker-compose.yml
    URL=https://google.com docker compose up --build
  2. Go to http://localhost:8000/page.png to get a screenshot of the website provided by the URL. You should get a HTTP 204 response until the first screenshot has been made and afterwards the latest available screenshot.

You can also use an .env file:

# .env
URL=https://google.com
docker compose up

There are no prebuilt images available yet.

node.js

This is also not too bad as Puppeteer downloads the required browsers automatically, faster for development.

  1. npm install (once to install dependencies)
  2. Create an .env file to set up environment variables.
# .env
URL=https://google.com
  1. npm start to run the server.
  2. Go to http://localhost:8000/page.png to get a screenshot of the website provided by the URL. You should get a HTTP 204 response until the first screenshot has been made and afterwards the latest available screenshot.

Built With

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Simple proxy that serves a website as an image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published