Rozbot/lib/promise/feed.js
2016-07-11 23:24:15 -04:00

14 lines
288 B
JavaScript

var feed = require('feed-read');
var promise = require('promise-polyfill');
module.exports = function(link) {
return new promise(function(resolve, reject) {
feed(link, function(error, articles) {
if (error) {
reject(error);
} else {
resolve(articles);
}
});
});
}