on master help sign in
Added link to download OPML of all RSS feeds.
commitbfe0e8938f03da161012d6ce17c4b2eefd6723bc authorjrc03c <jrc03c@pm.me> dateSun 30 Jun 2019, 11:24 (7 years ago) parent425de47
3 files changed+13−1
index.html+1 scripts/opml.js+11 scripts/portal.js+1−1
index.html+1
@@ -7,6 +7,7 @@
77 <link rel="stylesheet" type="text/css" href="links/main.css"/>
88 <script src="scripts/portal.js"></script>
99 <script src="scripts/sites.js"></script>
10+ <script src="scripts/opml.js"></script>
1011 <title>Webring</title>
1112</head>
1213<body>
scripts/opml.jsnew file+11
@@ -0,0 +1,11 @@
1+let outlines = sites.filter((site) => !!site.rss).map((site) => {
2+ return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`;
3+});
4+
5+let template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join("")}</body></opml>`;
6+
7+window.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");
11+}
scripts/portal.js+1−1
@@ -11,7 +11,7 @@ function Portal (sites) {
1111 }
1212
1313 function _buttons () {
14− return `<p class='buttons'><a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
14+ return `<p class='buttons'><a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a> | <a id="opml">OPML</a></p>`
1515 }
1616
1717 function _directory (sites) {