forked from GitHub/dbot
fix
This commit is contained in:
parent
fbdec17670
commit
c50975672e
@ -3,7 +3,8 @@
|
|||||||
* Description: Allows to read RSS feeds
|
* Description: Allows to read RSS feeds
|
||||||
*/
|
*/
|
||||||
var FeedParser = require('feedparser')
|
var FeedParser = require('feedparser')
|
||||||
, request = require('request');
|
, request = require('request')
|
||||||
|
, _ = require('underscore')._;
|
||||||
|
|
||||||
var rss = function(dbot) {
|
var rss = function(dbot) {
|
||||||
this.pollInterval = 120000;
|
this.pollInterval = 120000;
|
||||||
@ -54,7 +55,7 @@ var rss = function(dbot) {
|
|||||||
request(options, function (error, response, body) {
|
request(options, function (error, response, body) {
|
||||||
if (!error && response.statusCode === 200) {
|
if (!error && response.statusCode === 200) {
|
||||||
var rString = "["+feed.name+"] ["+rss.title+"] ";
|
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 += "[Post by "+rss.author+" in "+rss.categories[0]+"] ";
|
||||||
}
|
}
|
||||||
rString += "- "+body.id;
|
rString += "- "+body.id;
|
||||||
|
Loading…
Reference in New Issue
Block a user