https://github.com/cvan/firesnaggle
a REST-ful API for generating a screenshot from a URL in Firefox (using slimerjs)
https://github.com/cvan/firesnaggle
Last synced: about 1 year ago
JSON representation
a REST-ful API for generating a screenshot from a URL in Firefox (using slimerjs)
- Host: GitHub
- URL: https://github.com/cvan/firesnaggle
- Owner: cvan
- Created: 2013-12-17T10:14:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-12T18:57:27.000Z (over 12 years ago)
- Last Synced: 2025-03-23T18:05:00.951Z (about 1 year ago)
- Language: JavaScript
- Size: 845 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# firesnaggle
What's that? You have a website URL. And you need, what, a screenshot (and
the HTML) of said website at mobile width in Firefox? Well, gee golly, no
look no further! Snaggle up with firesnaggle™ today!
This tool is made possible by the fantastic [slimerjs](http://slimerjs.org/)
library.
## Installation
* `npm install`
* `cp settings_local.js.dist settings_local.js`
* `nodemon app.js`
* `./install-packages.sh`
## Deployment
To deploy to stackato:
stackato push --no-prompt
## Sample Usage
### Get a screenshot
#### `POST`
curl -X POST 'http://localhost:5000/screenshot'
-d 'width=320&height=480&delay=5000&url=http://www.mysnuggiestore.com'
-H 'Accept: image/gif,image/png'
#### `GET`
curl 'http://localhost:5000/screenshot?width=320&height=480&delay=5000&url=http://www.mysnuggiestore.com'
-H 'Accept: image/gif,image/png'
#### Render in a browser
Fire up [http://localhost:5000/static/demo.html](http://localhost:5000/static/demo.html)
### Delete a screenshot
#### `DELETE`
curl -iX DELETE 'http://localhost:5000/screenshot?url=http://www.mysnuggiestore.com'
-H 'Accept: image/gif,image/png'
### Get the HTML
To get the resulting HTML after the JS has been loaded:
#### `GET`
curl 'http://localhost:5000/html?delay=5000&url=http://www.mysnuggiestore.com'
#### `DELETE`
curl -X DELETE 'http://localhost:5000/html?url=http://www.mysnuggiestore.com'
### Get the HTML, page title, and final URL
To get the resulting HTML, page title, and final URL after the JS has been loaded:
#### `GET`
curl 'http://localhost:5000/json?delay=5000&url=http://www.mysnuggiestore.com'
#### `DELETE`
curl -X DELETE 'http://localhost:5000/json?url=http://www.mysnuggiestore.com'