我正在尝试使实时标签订阅正常工作,但似乎实时更新仅在一分钟内更新。这是我的代码,你能指出我缺少什么吗?
var Instagram = require('instagram-node-lib');
app.get('/GetInstagram', function(request, response){
// The GET callback for each subscription verification.
var params = url.parse(request.url, true).query;
response.send(params['hub.challenge'] || 'No hub.challenge present');
});
app.post('/GetInstagram', function (req, res) {
var tagName = 'love';
Instagram.set('client_id', 'clientID');
Instagram.set('client_secret', 'ClientSecret');
Instagram.tags.subscribe ({ object_id: tagName,access_token: null, client_id: 'clientid', client_secret: 'clientsecret', callback_url: 'http://myURL/GetInstagram', complete: function()
{
console.log('begin fetching');
Instagram.tags.recent({ name: tagName,aspect: 'media', complete: function(data, pagination )
{
var chunk = { 'pagination': pagination, 'data': data };
console.log (chunk.data.length);
var len = 0;
for (var i = 0, len = chunk.data.length; i < len; i++)
{
var url = '"' + chunk.data[i].images.standard_resolution.url + '"';
console.log('image from instagram image # ' + i + ' image URL' + chunk.data[i].images.standard_resolution.url );
}
res.end();
}
});
}
});
});