Skip to content
This repository

Not working with Facebook RSS #39

Closed
saturngod opened this Issue December 10, 2012 · 4 comments

3 participants

Htain Lin Shwe Vincent Agnano Dan MacTough
Htain Lin Shwe
var feedparser = require('feedparser');
var request = require('request');

function callback (article) {
  console.log('Got article: %s', JSON.stringify(article));
}

feedparser.parseUrl('https://www.facebook.com/feeds/page.php?id=158797964140471&format=rss20')
  .on('article', callback);

got following error

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: Remote server did not respond with a feed
    at Request.FeedParser.parseUrl.handleResponse (/Users/lusi/SkyDrive/Projects/Web/arryone/node_modules/feedparser/main.js:1169:13)
    at Request.EventEmitter.emit (events.js:96:17)
    at ClientRequest.<anonymous> (/Users/lusi/SkyDrive/Projects/Web/arryone/node_modules/feedparser/node_modules/request/main.js:521:12)
    at ClientRequest.g (events.js:192:14)
    at ClientRequest.EventEmitter.emit (events.js:96:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1462:7)
    at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
    at Socket.socketOnData [as ondata] (http.js:1367:20)
    at TCP.onread (net.js:403:27)
Htain Lin Shwe

Fixed , need to add header

var reqObj = {'uri': 'https://www.facebook.com/feeds/page.php?id=158797964140471&format=rss20',
'headers': {'user-agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11'}};

request(reqObj, function (error, response, body) {
});

Htain Lin Shwe saturngod closed this December 10, 2012
Vincent Agnano

+1. @saturngod : thanks for the fix !

Dan MacTough
Owner

As of 13d19af, FeedParser.parseUrl() can take handle those headers directly.

See: https://github.com/danmactough/node-feedparser/blob/master/examples/parseUrl.js

Vincent Agnano

Great ! Updated package and just works fine now. Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.