node.js获取RSS返回json
安装依赖包
npm install rsj
示例
rsj = require('rsj');//RSS as JSON when use it we must (npm install rsj) first rsj.r2j('http://news.ifeng.com/pubres/rss/opinion/phjd/feed.xml',function(json) { var obj = eval('(' + json + ')');//js原生方法 //var obj = JSON.parse(json);//json.js包 res.render('index', { title: 'testbook',layout:'layout',nav:'index',rssData:obj}); });
相关推荐
wanxuncpx 2020-06-01
malachuan 2020-05-17
IT前沿 2020-04-25
Vikingsoft 2020-04-23
晚安假行僧 2020-02-09
malachuan 2019-11-11
徐汇业大信息中心 2011-09-25
xiaomingqing 2015-06-29
chennai0 2015-07-22
panpanhappy 2019-07-15
iComputer 2019-09-05
川大门口贴膜小哥 2018-09-18
Vikingsoft 2018-08-18
IT前沿 2014-06-03
panpanhappy 2011-04-17
IT前沿 2013-08-27
灬扫地僧 2013-05-17