Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created May 7, 2014 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhoff/5aeec62219afd9ac073a to your computer and use it in GitHub Desktop.
Save alanhoff/5aeec62219afd9ac073a to your computer and use it in GitHub Desktop.
var cheerio = require('cheerio');
var request = require('request');
request.get('http://gshow.globo.com/programas/na-moral/videos/feed.atom', function(err, headers, body){
if(err)
throw err;
if(headers.statusCode !== 200)
throw new Error('Resposta não OK.');
var $ = cheerio.load(body);
var noticias = [];
$('entry').each(function(i, el){
noticias.push({
titulo : $(el).find('title').first().text(),
publicado : $(el).find('published').first().text()
});
});
console.log(noticias);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment