Published
Edited
Oct 27, 2021
Importers
1 star
Insert cell
Insert cell
url = "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
Insert cell
Insert cell
parser = {
const RSSParser = await require('https://bundle.run/rss-parser@3.9.0');
return new RSSParser();
}
Insert cell
data1 = parser.parseString(await fetchText(url))
Insert cell
Insert cell
import { xmlToJSON } from "@visnup/xml-to-json"
Insert cell
data2 = xmlToJSON(await fetchText(url))
Insert cell
Insert cell
function fetchText(URL) {
return fetch(URL).then((res) => res.text());
}
Insert cell
async function parseRSS(url) {
return parser.parseString(await fetchText(url));
}
Insert cell
async function parseRSSCORS(url) {
return parser.parseString(await fetchp(url).then((res) => res.text()));
}
Insert cell
import { fetchp } from "@tomlarkworthy/fetchp"
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.
Learn more