0
我正在爲NodeJS開發IRC bot,機器人進入渠道,但它不顯示最新的飼料,也顯示控制檯中的任何錯誤。 我從CNN進料檢驗開始:Bot IRC顯示飼料不起作用
http://rss.cnn.com/rss/cnn_latest.rss
notify.js
var FEEDSUB = require('feedsub');
var IRC = require('irc');
// Set up your little spambot
var server = 'irc.servercentral.net';
var bot = 'feed-bot';
var channels = ['#testme'];
var feed = 'http://rss.cnn.com/rss/cnn_latest.rss';
var interval = 1 // how often to poll the feed, in minutes?
client = new IRC.Client(server, bot,
{
channels: channels,
realName: 'nodejs IRC bot',
autoRejoin: true,
autoConnect: true,
});
reader = new FEEDSUB(feed, {
interval: interval,
autoStart: true,
});
reader.on('item', function(item) {
client.say(channels, item.title + ': ' + item.link);
console.dir(item.title);
});