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

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