Published
Edited
Dec 12, 2021
Fork of rss-parser
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//IN CASE OF ERROR 401 RUN THIS CELL

resultNerd = await axios({
url: 'https://nerd.it.itba.edu.ar/api/auth/token',
method: 'post',
headers: {
accept: 'application/json',
'Content-Type': 'application/json'
},
data: {
grant_type: 'password',
username: 'nerdapi@mailinator.com',
password: 'p455w0rd'
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// mirando los atributos que trae cada item
//

data.items[0]

/**
CLARIN
======
creator: "Clarin.com"
title: "Yo soy Betty, la fea: la trágica historia de Lina …z que se quitó la vida luego del éxito de la tira"
link: "http://www.clarin.com/internacional/espectaculos/b…triz-quito-vida-luego-exito-tira_0_C-53pzNGi.html"
pubDate: "Thu, 20 Aug 2020 15:07:24 -0300"
enclosure: Object {url: "https://images.clarin.com/2020/08/20/t_oNzGi_-_600x338__1.jpg", length: "0", type: "image/jpg"}
dc:creator: "Clarin.com"
content: "El doloroso final hace diez años de la joven colom…ba el grupo que pretendía enamorar a Don Armando."
contentSnippet: "El doloroso final hace diez años de la joven colom…ba el grupo que pretendía enamorar a Don Armando."
guid: "http://www.clarin.com/internacional/espectaculos/b…triz-quito-vida-luego-exito-tira_0_C-53pzNGi.html"
isoDate: "2020-08-20T18:07:24.000Z"

INFOBAE
======
creator: ""
title: "AP Explica: ¿Cuál es la diferencia entre cáñamo y marihuana?"
link: "https://www.infobae.com/america/agencias/2020/08/2…a-cual-es-la-diferencia-entre-canamo-y-marihuana/"
pubDate: "Thu, 20 Aug 2020 18:18:36 +0000"
content:encoded: "<p>MONTEVIDEO (AP) — Uruguay fue el primer país en…que autorizan su consumo o industrialización.</p>"
content:encodedSnippet: "MONTEVIDEO (AP) — Uruguay fue el primer país en re…ses que autorizan su consumo o industrialización."
dc:creator: ""
content: ""
contentSnippet: ""
guid: "https://www.infobae.com/america/agencias/2020/08/2…a-cual-es-la-diferencia-entre-canamo-y-marihuana/"
isoDate: "2020-08-20T18:18:36.000Z"
LA NACION
=====================
title: "IDEA expresó su preocupación por el DNU que declara esenciales a las \"telcos\""
link: "https://www.lanacion.com.ar/economia/idea-expreso-su-preocupacion-dnu-declara-esenciales-nid2435086"
pubDate: "2020-08-29T21:04:00.000Z"
author: "lanacion.com"
content: "<div type=\"xhtml\"><div xmlns=\"http://www.w3.org/19…om/anexos/fotos/69/3280869w346.jpg\"/></div></div>"
contentSnippet: "Los empresarios que forman parte del Instituto par… como servicios públicos, congelando sus precios."
id: "https://www.lanacion.com.ar/economia/idea-expreso-su-preocupacion-dnu-declara-esenciales-nid2435086"
isoDate: "2020-08-29T21:04:00.000Z"
**/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
$ = cheerio.load(result.data);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
headline = getHeadline(source)
Insert cell
subHeadline = getSubHeadline(source)
Insert cell
paragraphs = getParagraphs(source)
Insert cell
section = getSection(source)
Insert cell
tags = getTags(source)
Insert cell
color = getColor(source)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
PER = entities.data['entities'].filter(word => word.label === 'PER').reduce(function(entitiesCount, x){
var currentEntity = cleanText.slice(x.start,x.end);
if(typeof entitiesCount[currentEntity] !== "undefined"){
entitiesCount[currentEntity]++;
return entitiesCount;
} else {
entitiesCount[currentEntity]=1;
return entitiesCount;
}
}, {});
Insert cell
ORG = entities.data['entities'].filter(word => word.label === 'ORG').reduce(function(entitiesCount, x){
var currentEntity = cleanText.slice(x.start,x.end);
if(typeof entitiesCount[currentEntity] !== "undefined"){
entitiesCount[currentEntity]++;
return entitiesCount;
} else {
entitiesCount[currentEntity]=1;
return entitiesCount;
}
}, {});
Insert cell
MISC = entities.data['entities'].filter(word => word.label === 'MISC').reduce(function(entitiesCount, x){
var currentEntity = cleanText.slice(x.start,x.end);
if(typeof entitiesCount[currentEntity] !== "undefined"){
entitiesCount[currentEntity]++;
return entitiesCount;
} else {
entitiesCount[currentEntity]=1;
return entitiesCount;
}
}, {});
Insert cell
LOC = entities.data['entities'].filter(word => word.label === 'LOC').reduce(function(entitiesCount, x){
var currentEntity = cleanText.slice(x.start,x.end);
if(typeof entitiesCount[currentEntity] !== "undefined"){
entitiesCount[currentEntity]++;
return entitiesCount;
} else {
entitiesCount[currentEntity]=1;
return entitiesCount;
}
}, {});
Insert cell
Insert cell
clean_title = new_selected.title.normalize('NFD').replace(/[\u0300-\u036f]/g,"").replace(/[^a-z ]/gi, '')
Insert cell
checkNews = await axios({
url: cors_prefix + "https://chequeabot.chequeado.com/buscador_api/texto?query="+ "hola",
method: 'get',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
}
})
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more