Simple HTTP API to capture webshots.
Proof of concept only! Not for production usage.
-
Just start puma server (or any other rack based server)
-
Send API request
GET /webshot/google.com.png/800/600
Response will contain image of http://google.com
rendered by webkit
with 800x600
viewport size and saved in png
format.
- format –
png
,jpg
,json
- png – for good quality
- jpg – for slow bandwith
- json – response contains base64 encoded image
{"image":"/9j/4AAQSkZJRgABAQEASABIAAD/..."}
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request