Closed vseledkin closed 11 years ago
Two things:
feedurl
option. That must be a String
, not a Boolean
, and that's what's actually causing the error.If you need to supply the feedurl (which you shouldn't when you're using parseUrl
), then make sure to use the actual feed, not true
.
try the code below
var parser = require('feedparser'); var url = 'http://com-stol.ru/?feed=rss2'; parser.parseUrl( url,
{ addmeta: false, feedurl: true }, function(e, meta, articles){ console.log('got % articles from %s feed',articles.length, url); } );
results:
url.js:118 throw new TypeError("Parameter 'url' must be a string, not " + typeof url) ^ TypeError: Parameter 'url' must be a string, not boolean at Url.parse (url.js:118:11) at urlParse (url.js:112:5) at Object.urlResolve as resolve at Object.resolve (/Users/vseledkin/WORK/feedstore/node_modules/feedparser/utils.js:111:14) at FeedParser. (/Users/vseledkin/WORK/feedstore/node_modules/feedparser/main.js:388:26)
at Array.forEach (native)
at FeedParser.handleAttributes (/Users/vseledkin/WORK/feedstore/node_modules/feedparser/main.js:370:22)
at FeedParser.handleOpenTag (/Users/vseledkin/WORK/feedstore/node_modules/feedparser/main.js:170:19)
at SAXStream.EventEmitter.emit (events.js:95:17)
I assume that there is something with URL API changes in node v0.10.0