danmactough / node-feedparser

Robust RSS, Atom, and RDF feed parsing in Node.js
Other
1.97k stars 192 forks source link

"Not a feed" for something that looks valid #155

Closed crrobinson14 closed 8 years ago

crrobinson14 commented 8 years ago

Hey folks, I'm trying to process http://rssfeeds.usatoday.com/usatoday-NewsTopStories with this tool and it's throwing a "Not a feed" error. This is being processed fine by other feed processors such as https://pypi.python.org/pypi/feedparser and it looks visually OK. It's missing the open XML tag but I tried dumping it to an XML file and putting that in there as a test and that doesn't resolve the error. Appreciate any advice.

danmactough commented 8 years ago

@crrobinson14 The feed is probably being served with gzip compression. Take a look at this example for how to make sure you're sending plain text to feedparser: https://github.com/danmactough/node-feedparser/blob/master/examples/compressed.js

crrobinson14 commented 8 years ago

Thanks, @danmactough. It wasn't gzip'd but that tip helped me sort it out by hooking in at the spot where you did the example above. When I looked at the raw data there it turned out the site is sending back an alternate response based on user-agent and other headers. Different problem but similar solution. Thanks!

danmactough commented 8 years ago

Glad you figured it out.