on master help sign in
Starting work on hallway
commit69fe92fe1cab8f5ab5af1373a825e5b7a8849b47 authorDevine Lu Linvega <aliceffekt@gmail.com> dateTue 2 Jul 2019, 08:07 (7 years ago) parentd3e2283
5 files changed+51−11
hallway.html+19 scripts/hallway.js+21 scripts/opml.js+8−8 scripts/portal.js+1−1 scripts/sites.js+2−2
hallway.htmlnew file+19
@@ -0,0 +1,19 @@
1+<!DOCTYPE html>
2+<html lang="en">
3+<head>
4+ <meta charset="utf-8">
5+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6+ <link rel="stylesheet" type="text/css" href="links/fonts.css"/>
7+ <link rel="stylesheet" type="text/css" href="links/main.css"/>
8+ <script src="scripts/hallway.js"></script>
9+ <script src="scripts/sites.js"></script>
10+ <title>Hallway</title>
11+</head>
12+<body>
13+ <script>
14+ const hallway = new Hallway(sites);
15+ hallway.install(document.body);
16+ hallway.start();
17+ </script>
18+</body>
19+</html>
scripts/hallway.jsnew file+21
@@ -0,0 +1,21 @@
1+'use strict'
2+
3+function Hallway (sites) {
4+ this.sites = sites
5+ this.el = document.createElement('div')
6+
7+ this.install = function (host) {
8+ host.appendChild(this.el)
9+ }
10+
11+ this.start = function () {
12+ this.el.innerHTML = 'hello'
13+ this.fetch('https://wiki.xxiivv.com/twtxt.txt')
14+ }
15+
16+ this.fetch = function (location) {
17+ Promise.all([ fetch(location).then(x => x.text()) ]).then(([sampleResp]) => {
18+ console.log(sampleResp)
19+ })
20+ }
21+}
scripts/opml.js+8−8
@@ -1,11 +1,11 @@
11let outlines = sites.filter((site) => !!site.rss).map((site) => {
2− return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`;
3−});
2+ return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`
3+})
44
5−let template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join("")}</body></opml>`;
5+let template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join('')}</body></opml>`
66
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−}
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
@@ -19,7 +19,7 @@ function Portal (sites) {
1919 <ul>${sites.reduce((acc, site, id) => { return `${acc}<li class='${site.type}'><span class='counter'>${id})</span><a href='${site.url}'>${_name(site)}</a></li>` }, '')}</ul>\n${_readme()}${_buttons()}`
2020 }
2121
22− function _name(site) {
22+ function _name (site) {
2323 return site.title ? site.title : `${site.url.split('//')[1]}`
2424 }
2525
scripts/sites.js+2−2
@@ -4,7 +4,7 @@
44// protocol://url.domain.ext
55
66const sites = [
7− {url:"https://wiki.xxiivv.com", title:"xxiivv", type:"wiki", author:"Devine Lu Linvega", contact:"aliceffekt@gmail.com", rss:"https://wiki.xxiivv.com/links/rss.xml"}
7+ {url:"https://wiki.xxiivv.com", title:"xxiivv", type:"wiki", author:"Devine Lu Linvega", contact:"aliceffekt@gmail.com", rss:"https://wiki.xxiivv.com/links/rss.xml", feed:"https://wiki.xxiivv.com/twtxt.txt"}
88 , {url:"http://estevancarlos.com"}
99 , {url:"https://electro.pizza", title:"electro pizza", type:"blog", rss:"https://electro.pizza/feed.xml"}
1010 , {url:"https://ianjbattaglia.co"}
@@ -26,7 +26,7 @@ const sites = [
2626 , {url:"https://craze.co.uk"}
2727 , {url:"https://shaneckel.com"}
2828 , {url:"https://cblgh.org"}
29− , {url:"https://ellugar.co", title:"ellugar", type:"wiki", author"afk", contact:"afk@ellugar.co", rss:"http://feeds.ellugar.co/ellugar-logs"}
29+ , {url:"https://ellugar.co", title:"ellugar", type:"wiki", author:"afk", contact:"afk@ellugar.co", rss:"http://feeds.ellugar.co/ellugar-logs"}
3030 , {url:"http://hur.bet"}
3131 , {url:"http://chigby.org"}
3232 , {url:"https://longest.voyage"}