⚠️ This is no longer maintained ⚠️
A simple screenshot web service powered by Kue, Express and electron. Inspired by fzaninotto/screenshot-as-a-service
This screenshot-service is using node-webkit which comes with a recent version of Chromium. In contrast to phantomjs node-webkit supports 3D CSS and WebGL and therefore can produce better screenshots.
See this DEMO (Be aware that it is running on a $5 digitalocean machine. Be patient!)
PATH
On OS X the node-webkit executable is called node-webkit
and on linux and Windows it's called nw
. Keep that in mind.
git clone https://github.com/FWeinb/nodeshot.git && cd nodeshot
./bootstrap.sh
./start.sh server
once./start.sh renderer X
where X
is is the number/name of the renderer. (You can start more than one)http://localhost:8080/?url=http://s.codepen.io/FWeinb/fullpage/oyACz
http://localhost:8080/kue
for queued jobs. (See the password in nodeshot-server/config/default.yaml
.)The result of each request will be the requested image.
GET /?url=www.google.com
Returns a 1024x600 PNG screenshot of the www.google.com homepage
GET /?url=www.google.com&transparent=true
Returns a 1024x600 PNG screenshot of the www.google.com homepage
GET /?url=www.google.com&page=true
Returns a screenshot of the whole www.google.com homepage
GET /?url=www.google.com&width=800&height=600
Returns a 800x600 PNG screenshot of the www.google.com homepage
GET /?url=www.google.com&delay=1000
Returns a 1024x600 PNG screenshot of the www.google.com homepage 1 second after it's loaded
GET /?url=www.google.com&forceReload=1
Deletes current version in cache and returns a (new) 1024x600 PNG screenshot of the www.google.com homepage, which will be cached again
The result of each request will be an JSON object.
Same options as in the Simple API. Just prefix the request with /ajax/
Example:
# Take a screenshot
GET /ajax/?url=www.google.com
# Success: 200 {"request" : "success", "url" : "[URL to resulting image]"}
# Error: 500 {"request" : "failed", "reason" : "[Message]"}
This project is using node-config.
node-webkit can pass startup flags to chromium via the chromium-args
value
in the package.json
. See node-webkit manifest-format for more information.
Please change the default password in nodeshot-server/config/default.yaml
DISCLAIMER: For WebGL/3D CSS support you need hardware acceleration. Keep that in mind!
https://www.digitalocean.com/
ssh
sudo apt-get install xorg
sudo apt-get install xvfb
sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
sudo apt-get install -y x-ttcidfont-conf cabextract ttf-mscorefonts-installer
(Accept the EULA)sudo dpkg-reconfigure --default-priority x-ttcidfont-conf
(This fixed an issue for me)xvfb :99 &
export DISPLAY=:99
PATH
git clone https://github.com/fweinb/nodeshot && cd nodeshot
./bootstrap.sh
./start.sh server
once./start.sh renderer X
where X
is is the number/name of the renderer. (You can start more than one)http://[IP]:8080/?url=http://s.codepen.io/FWeinb/fullpage/oyACz
Joshua Hibbert for creating the logo.