Closed heloscream closed 6 years ago
@heloscream If you're getting a 502 error, that means the remote server is experiencing a major error. That isn't related to feedparser.
thank for replying, but if I paste this URL into a browser, it shows RSS, and also if I print err .stack, it will say no a Feed
Error: Not a feed
at FeedParser.handleEnd (/home/hemant/Desktop/feeds/node_modules/feedparser/lib/feedparser/index.js:119:13)
at emitNone (events.js:106:13)
at SAXStream.emit (events.js:208:7)
at SAXParser.SAXStream._parser.onend (/home/hemant/Desktop/feeds/node_modules/sax/lib/sax.js:190:10)
at emit (/home/hemant/Desktop/feeds/node_modules/sax/lib/sax.js:624:35)
at end (/home/hemant/Desktop/feeds/node_modules/sax/lib/sax.js:667:5)
at SAXParser.end (/home/hemant/Desktop/feeds/node_modules/sax/lib/sax.js:154:24)
at SAXStream.end (/home/hemant/Desktop/feeds/node_modules/sax/lib/sax.js:248:18)
at FeedParser._flush (/home/hemant/Desktop/feeds/node_modules/feedparser/lib/feedparser/index.js:1089:17)
at FeedParser.
thank for replying, but if I paste this URL into a browser, it shows RSS
If you don't share the URL, there's really nothing more I can do to help.
and also if I print err .stack, it will say no a Feed
That's correct: The remote server isn't returning a feed, it's returning a 502 error page.
sorry from my end, I was using wrong way to fetch from querying URL, eg pullRequest = request(encodeURI(req.query.q), {timeout: 10000, pool: false}, function(error, response, body) { // I didn't use encodeURI( ) method , for this kind of urls http://xyz- sites/category/se%C3%A7%C3%B5es if(response) { status = response.statusCode; // Print the response status code if a response was received if(status === 200) { statusResponse = { message: 'request success'} } else if(status === 404) { statusResponse = { message: 'request page not found !!!'} } else { statusResponse = { message: 'Indernal server request error'} } } else if( error ) { status = 400; statusResponse = { message: 'bad Request 400'} } });
now everything works smoothly n cool thanks a lot for ur support
[checked] Review the compressed example.
[* ] Include which version of FeedParser you're using. Feed parser 2.2.7(latest one, i guess)
[*] Include which version of Node you're using. node 8.9.3
[*] Include a link to any feed you're having a problem with. sorry can't show you the real URL but I checked it works fine
eg> http://feeds.bbc.co.uk/hindi/index.xml works fine, but when I try something URL which has some special character like other languages like (http://xyz-sites/category/se%C3%A7%C3%B5es) throw me 502 error
the URL that I 'm passing is valid eg http://xyz-sites/category/se%C3%A7%C3%B5es, but turns out just because of URL encoding like mentioned above (% ) signs but it was not, I tried js decodeURI methods as well in decodeURI(req.query.q) resulted in ( http://xyz-sites/category/seções) but still getting 502 error, tried everything but getting nowhere, help would be appreciated, thanks in advance