forked from GitHub/dbot
dont post the thingy if there is no category or author
This commit is contained in:
parent
ecec80ac58
commit
fbdec17670
@ -52,8 +52,13 @@ 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) {
|
||||||
dbot.say(feed.server,feed.channel,"["+feed.name+"] ["+rss.title+"] [Post by "+rss.author+" in "+rss.categories[0]+"] - "+body.id);
|
var rString = "["+feed.name+"] ["+rss.title+"] ";
|
||||||
|
if(rss.author && rss.categories[0]) {
|
||||||
|
rString += "[Post by "+rss.author+" in "+rss.categories[0]+"] ";
|
||||||
|
}
|
||||||
|
rString += "- "+body.id;
|
||||||
|
dbot.say(feed.server,feed.channel, rString);
|
||||||
} else {
|
} else {
|
||||||
dbot.say(feed.server,feed.channel,"RSS: Request to shorten URL returned: "+body.id);
|
dbot.say(feed.server,feed.channel,"RSS: Request to shorten URL returned: "+body.id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user