3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00
This commit is contained in:
reality 2014-06-16 16:20:26 +00:00
parent fbdec17670
commit c50975672e

View File

@ -3,7 +3,8 @@
* Description: Allows to read RSS feeds
*/
var FeedParser = require('feedparser')
, request = require('request');
, request = require('request')
, _ = require('underscore')._;
var rss = function(dbot) {
this.pollInterval = 120000;
@ -54,7 +55,7 @@ var rss = function(dbot) {
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
var rString = "["+feed.name+"] ["+rss.title+"] ";
if(rss.author && rss.categories[0]) {
if(rss.author !== null && !_.isUndefined(rss.categories[0])) {
rString += "[Post by "+rss.author+" in "+rss.categories[0]+"] ";
}
rString += "- "+body.id;