webshot-amqp-client

a client library to request and receive screenshots from the webshot-queue AMQP server

webshot-amqp-client

A client library to request and receive screenshots from the webshot-amqp AMQP server.

Installation

npm install webshot-amqp-client

Usage

Listening for new screenshots:

var client = require('webshot-amqp-client');
 
// call init() and pass it a callback function 
client.init(function() {
 
    // define what to do when a screenshot arrives on the queue 
    client.onScreenshot(function(errmsg) {
        // "msg" is an object with cloudinary metadata, 
        // including the public URL of the screenshot. 
    });
    
});

Placing a screenshot request to the webshot-amqp server:

var client = require('webshot-amqp-client');
 
// call init() and pass it a callback function 
client.init(function() {
 
    client.requestScreenshot('http://www.github.com');
    
});