Skip to content Skip to sidebar Skip to footer

Does Google Feed Api Enable Access Via Node.js?

I want to use Google Feed API from a server (Node.js). I have already installed the googleapis module. My code is: // parts omitted var googleapis = require('googleapis'); // parts

Solution 1:

to access Google Feed API using Node.js, you should try the google-feed-api module as explained here:

https://www.npmjs.org/package/google-feed-api

Hope it helps!

Edit:

I tried this with your URL and worked fine:

var gfeed = require('google-feed-api');
var feed = new gfeed.Feed('http://rss.lemonde.fr/c/205/f/3050/index.rss');
feed.listItems(function(items){
    console.log(items);
});

Solution 2:

It's because google is literally not defined. I don't know very much about that module, but I think that instead of using the google var you should use client , because that's what the execute function returns. So the code would be:

// parts omittedvar googleapis = require('googleapis');
// parts omitted
googleapis.discover('feeds').execute(function(err, client) {
var feed = new client.feeds.Feed('http://rss.lemonde.fr/c/205/f/3050/index.rss');
});
// parts omitted

Post a Comment for "Does Google Feed Api Enable Access Via Node.js?"