on bfe0e89 help sign in
webring/scripts/opml.js
11 lines 495 B history raw
1let outlines = sites.filter((site) => !!site.rss).map((site) => {
2 return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`;
3});
5let template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join("")}</body></opml>`;
7window.onload = function(){
8 let a = document.getElementById("opml");
9 a.setAttribute("href", "data:text/plain;charset=utf-8," + window.encodeURIComponent(template));
10 a.setAttribute("download", "webring.opml");