instagram-node
Version:
Simple Instagram driver for Node.js
56 lines (45 loc) • 1.2 kB
JavaScript
var fwk = require('fwk');
var cfg = fwk.populateConfig(require('../../config.js').config);
var instagram = require('../../lib/instagram.js').instagram();
instagram.use({
access_token: cfg['INSTAGRAM_ACCESS_TOKEN']
});
/**
* Some test about comments features
*/
var comments = (function(spec, my) {
var _super = {};
my = my || {};
// public
var todo;
// private
var that = require('../test_base.js').test_base({ name: 'comments' });
todo = function() {
var tests = {
'comments': function(cb_) {
var retry = 0;
instagram.comments('318869204166248215_33082304', function(err, result, remaining, limit) {
var res = {
ok: true,
description: 'Retrieves comments'
};
if(result && remaining) {
return cb_(null, res);
} else {
if(retry < 2) {
that.retry(res.description, ++retry);
err.retry();
} else {
res.ok = false;
return cb_(null, res);
}
}
});
}
};
return tests;
};
fwk.method(that, 'todo', todo, _super);
return that;
})({});
comments.launch();