Re: [nodejs] Nodejs / Google Feed API

264 views
Skip to first unread message

Dominic Tarr

unread,
Jul 16, 2012, 9:44:27 PM7/16/12
to nod...@googlegroups.com
you need to post the error.

On Mon, Jul 16, 2012 at 9:55 PM, Florian Shena <floria...@gmail.com> wrote:
> Hi everybody,
>
> I want to use the google feed API on my nodejs app. So far I've loaded the
> api using the Nodejs http.request but when I call google.load("feeds", "1")
> I get an error :
>
> var http = require('http');
>
> var options = {
> host: 'www.google.com',
> port: 80,
> path: '/jsapi',
> method: 'GET'
> };
>
> var req = http.request(options, function(res) {
>
> res.setEncoding('utf8');
>
> res.on('data', function (chunk) {
> console.log('BODY: ' + chunk.google.load("feeds", "1"));
> });
>
> res.on('error', function(e) {
> console.log('problem with request: ' + e.message);
> });
>
> });
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

Marco Rogers

unread,
Jul 17, 2012, 2:27:04 AM7/17/12
to nod...@googlegroups.com
It looks like you want to use the google jsapi in the server in node. I think you'll have a hard time because that library assumes a browser DOM environment. You can't just use it as is.

But that's not your only problem here. "chunk.google.load" doesn't make any sense. It sounds like you may need to spend a little time with a few tutorials on what's happening with the node http module. I would point you at a few but it's a pain because I'm on my phone.

Post some more code or ask some more questions and we'll try I help out.

:Marco

Mattijs Spierings

unread,
May 6, 2015, 9:49:28 AM5/6/15
to nod...@googlegroups.com
even better, get rid off the callback, it is not required:

Mattijs Spierings

unread,
May 6, 2015, 9:49:43 AM5/6/15
to nod...@googlegroups.com
Maybe a bit late, but I also needed the Google Feed option in NodeJS (Meteor) and  I just looked at the outgoing communication by the Feed service

The q=http://www.npr.org/rss/podcast.php?id=510289/rss is what you want to change yourself and probably the num=50. That is your return limit.
Also change the nocache variable for each request if you dont want caching.

Good luck!
Reply all
Reply to author
Forward
0 new messages