Public
Edited
Jan 19
Insert cell
Insert cell
Insert cell
Insert cell
rssDownload = {
const blob = new Blob([rssFeed], { type: "application/rss+xml" });
const url = URL.createObjectURL(blob);

return html`<a href="${url}" download="rss_feed.xml" style="font-size: 16px; color: blue;">Download RSS Feed</a>`;
}
Insert cell
rssFeed = {
const header = `<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Latest Replies from Panopticon</title>
<link>https://observablehq.com/@palimpsest/panopticon-latest-replies</link>
<description>RSS feed of the latest replies</description>
<language>en-us</language>
<pubDate>${new Date().toUTCString()}</pubDate>
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>`;
const items = posts.map(post => `
<item>
<title>${post.title}</title>
<link>${post.link}</link>
<description>${post.description}</description>
<pubDate>${post.pubDate}</pubDate>
</item>`).join("");
const footer = `
</channel>
</rss>`;

return header + items + footer;
}
Insert cell
posts = data.map(post => {
return {
title: post.topicTitle + " - " + post.user,
link: "https://qbn.com/reply/" + post.id,
pubDate: post.date,
description: post.post
}
});
Insert cell
Insert cell
Insert cell
import {getRepliesByAmount} from "be1c16dba078b46e"
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