npm.io
0.2.3 • Published 12 years ago

gunner

Licence
MIT
Version
0.2.3
Deps
2
Vulns
1
Weekly
0

Gunner.js

Tackle RESTful data and beat it into a useful format!

For example, load the first 2 pages of pictures on a subreddit:

var Gunner = require('Gunner');
(new Gunner("http://www.reddit.com/r/Pics/.json"))
    .projectile("data.children.*.data.url")
    .reloader({after: "data.after"})
    .limit(2)
    .fetcher(function (current, limit) {
        // Called on each HTTP load
        console.log('Fetching ' + current + ' of ' + limit);
    })
    .rapidfire(function (projectile, cannon) {
        // Called once for each link in the subreddit
        console.log(projectile);
    });

For full docs and source-code annotation, see the documented sources.