https://github.com/mdobes/web2screen
A simple website API written in express and phantomjs to creating a screenshots of websites!
https://github.com/mdobes/web2screen
api hacktoberfest screenshot web webscreenshot
Last synced: 10 months ago
JSON representation
A simple website API written in express and phantomjs to creating a screenshots of websites!
- Host: GitHub
- URL: https://github.com/mdobes/web2screen
- Owner: mdobes
- License: apache-2.0
- Created: 2020-10-08T19:43:18.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-14T18:27:42.000Z (over 5 years ago)
- Last Synced: 2025-07-24T17:54:48.842Z (11 months ago)
- Topics: api, hacktoberfest, screenshot, web, webscreenshot
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# web2screen
A simple website API written in express and phantomjs to creating a screenshots of websites!
### How to install?
Run in SSH:
```
git clone https://github.com/mdobes/web2screen.git
```
Go to folder web2screen
```
cd web2screen
```
Install Chromium
```
apt install chromium-browser -y
```
Install libs
```
npm install
```
Open ```config.json``` and edit it
```
{
"port": 3000, // the port to listen to
"token": "token", // security token
"defaults":{
"size": "1920,1080", // default resolution of screenshot
"sleep": 2000 // waiting time to load page
}
}
```
Install PM2
```
npm install pm2 -g
```
Run it in PM2
```
pm2 start index.js --name web2screen
```
Save PM2 and start it on startup
```
pm2 startup && pm2 save
```
### How to use?
```
GET ipadress.com:port/screenshot
```
| Parameter | Description | Example | Required |
|-----------|----------------------------|---------------------|---------------|
| url | A valid URL | https://example.com | Yes |
| token | Security token from config | token | Yes |
| size | Size of screenshot | 1920,1080 | No (optional) |
| sleep | Miliseconds to load a page | 1000 | No (optional) |