Node.js RSS模块
有没有办法使用Node.js,可能在实时读取RSS源?
谢谢
试试这个 。 这是一个实时的RSSparsing器教程。 请享用。
尝试node-feedparser
试试node-rss 。 虽然不稳定,但是您应该可以使用它来编写您自己的RSSparsing器。
/********************************************************************** Example One: Getting a remote RSS feed and parsing rss.parseURL(feed_url, use_excerpt, callback); **********************************************************************/ // URL of the feed you want to parse var feed_url = 'http://feeds.feedburner.com/github'; var response = rss.parseURL(feed_url, function(articles) { sys.puts(articles.length); for(i=0; i<articles.length; i++) { sys.puts("Article: "+i+", "+ articles[i].title+"\n"+ articles[i].link+"\n"+ articles[i].description+"\n"+ articles[i].content ); } });
试试这个,parsingrss,atom和feedburner
不知道实时..我见过大多数人用下面的例子使用SetTimeout轮询RSSurl..
function updateFeeds() { // Do some work. Possibly async // Call done() when finished. } function done() { setTimeout( updateFeeds, 1000 * 60 ); }
或者你可以尝试使用类似Node-Resque的任务队列。
但是这里有一些你可以从中获得的图书馆..
使用sax-js或Node FeedParser的 简单node.js rssparsing器
我find了一个相当不错的介绍,包含一个RSSparsing示例的Node JS
当我通过我的项目,我会通过任何新的调查结果更新这个答案..希望这有助于。