on master help sign in
Added link to download OPML of all RSS feeds.
bfe0e89jrc03c
index.html+1
@@ -7,6 +7,7 @@
7 <link rel="stylesheet" type="text/css" href="links/main.css"/>
7 <link rel="stylesheet" type="text/css" href="links/main.css"/>
8 <script src="scripts/portal.js"></script>
8 <script src="scripts/portal.js"></script>
9 <script src="scripts/sites.js"></script>
9 <script src="scripts/sites.js"></script>
10+ <script src="scripts/opml.js"></script>
10 <title>Webring</title>
11 <title>Webring</title>
11</head>
12</head>
12<body>
13<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) {
11 }
11 }
12
12
13 function _buttons () {
13 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>`
15 }
15 }
16
16
17 function _directory (sites) {
17 function _directory (sites) {