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

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