Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/staticallyio/screenshot
A screenshot API to convert web to image or PDF. Supports desktop and mobile views.
https://github.com/staticallyio/screenshot
docker nodejs productivity puppeteer screenshot screenshot-as-a-service
Last synced: about 1 month ago
JSON representation
A screenshot API to convert web to image or PDF. Supports desktop and mobile views.
- Host: GitHub
- URL: https://github.com/staticallyio/screenshot
- Owner: staticallyio
- License: mit
- Created: 2020-07-18T22:04:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-14T16:16:34.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T21:45:09.515Z (4 months ago)
- Topics: docker, nodejs, productivity, puppeteer, screenshot, screenshot-as-a-service
- Language: JavaScript
- Homepage: https://statically.io/docs/using-screenshot/
- Size: 1.5 MB
- Stars: 142
- Watchers: 3
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-made-by-indonesian - Screenshot - `Screenshot is a simple application to automagically convert URLs into images and PDFs. It's designed to be simple and easy to install anywhere. This application is split into two distinct components, the core service to process the URL and then send it to a remote browser (Chrome). The remote browser to screenshot and generate PDF from a URL.` *by [Frans Allen](https://github.com/fransallen)* (S)
- made-in-indonesia - Screenshot - `Screenshot is a simple application to automagically convert URLs into images and PDFs. It's designed to be simple and easy to install anywhere. This application is split into two distinct components, the core service to process the URL and then send it to a remote browser (Chrome). The remote browser to screenshot and generate PDF from a URL.` *by [Frans Allen](https://github.com/fransallen)* (S)
README
Screenshot
Automagically converts URLs into images and PDFs.
statically.io |
Twitter |
Community |
Become A Backer
## :sparkles: Overview
**Screenshot** is a simple application to automagically convert URLs into images and PDFs. It's designed to be simple and easy to install anywhere. This application is split into two distinct components, the core service to process the URL and then send it to a remote browser (Chrome). The remote browser to screenshot and generate PDF from a URL.
## :bulb: Features
- Screenshot website in desktop view.
- Screenshot website in mobile view.
- Converts URL into PDF.## :zap: Installation
We'll be using Docker as an easy way to install. However since this is a Node.js application, you can run it with your current setup, if you choose this method, please see [config/index.js](config/index.js) to change the remote browser endpoint.
### Run the browser
We'll be using the **browserless/chrome** Docker image to do most of this work.
```bash
docker run -d \
--name chrome \
-e "ENABLE_DEBUGGER=false" \
-e "DISABLE_AUTO_SET_DOWNLOAD_BEHAVIOR=true" \
-e "DEFAULT_BLOCK_ADS=true" \
-p 3000:3000 \
browserless/chrome:latest
```To see more options, you can check [full documentation](https://docs.browserless.io/docs/docker.html).
### Run the app
```bash
docker run -d \
--name screenshot \
-e "REMOTE_BROWSER=ws://172.17.0.1:3000" \
-p 5000:5000 \
statically/screenshot:latest
```Replace the `REMOTE_BROWSER` variable with the remote browser endpoint that you set above. In this example we are using Docker's internal IP address, it should work if you are running both components on one machine.
## :fire: Fire it up
The application avalaible through `/screenshot/` path.
- Visit http://localhost:5000/screenshot/github.com for desktop view.
![Screenshot Desktop](https://cdn.statically.io/gh/staticallyio/screenshot/master/public/screenshot-desktop.png)
- Visit http://localhost:5000/screenshot/mobile/github.com for mobile view.
![Screenshot Mobile](https://cdn.statically.io/gh/staticallyio/screenshot/master/public/screenshot-mobile.png)
- Visit http://localhost:5000/screenshot/pdf/news.ycombinator.com for PDF.
![Screenshot PDF](https://cdn.statically.io/gh/staticallyio/screenshot/master/public/screenshot-pdf.png)