Platform
Resources
Pricing
Sign in
Get started
Oliver Balfour
Workspace
Fork
Published
By
Oliver Balfour
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
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
source
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
new_selected
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
blank
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
resultNerd
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dateFrom
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dateTo
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
opt_sources
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sources
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getURL
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cors_prefix
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
parser
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fetchText
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
extent
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
axios
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cheerio
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bootstrap
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
code
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
link
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
result
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
$
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getHeadline
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getSubHeadline
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getParagraphs
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getSection
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getTags
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getColor
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getTweets
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tweets
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
headline
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
subHeadline
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
paragraphs
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
section
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tags
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
continueReading
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cr
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getCR
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
access_token
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
refresh_token
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cleanText
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
entities
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
PER
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ORG
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
MISC
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
LOC
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
clean_title
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
checkNews
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
checkFakeNews
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
check_query
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML