on master help sign in
Starting work on hallway
69fe92fDevine Lu Linvega
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 @@
1let outlines = sites.filter((site) => !!site.rss).map((site) => {
1let outlines = sites.filter((site) => !!site.rss).map((site) => {
2− return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`;
2+ return `<outline type="rss" xmlUrl="${site.rss}" title="${site.title}"/>`
3−});
3+})
4
4
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>`
6
6
7−window.onload = function(){
7+window.onload = function () {
8− let a = document.getElementById("opml");
8+ let a = document.getElementById('opml')
9− a.setAttribute("href", "data:text/plain;charset=utf-8," + window.encodeURIComponent(template));
9+ a.setAttribute('href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(template))
10− a.setAttribute("download", "webring.opml");
10+ a.setAttribute('download', 'webring.opml')
11−}
11+}
scripts/portal.js+1−1
@@ -19,7 +19,7 @@ function Portal (sites) {
19 <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()}`
19 <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()}`
20 }
20 }
21
21
22− function _name(site) {
22+ function _name (site) {
23 return site.title ? site.title : `${site.url.split('//')[1]}`
23 return site.title ? site.title : `${site.url.split('//')[1]}`
24 }
24 }
25
25
scripts/sites.js+2−2
@@ -4,7 +4,7 @@
4// protocol://url.domain.ext
4// protocol://url.domain.ext
5
5
6const sites = [
6const 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"}
8 , {url:"http://estevancarlos.com"}
8 , {url:"http://estevancarlos.com"}
9 , {url:"https://electro.pizza", title:"electro pizza", type:"blog", rss:"https://electro.pizza/feed.xml"}
9 , {url:"https://electro.pizza", title:"electro pizza", type:"blog", rss:"https://electro.pizza/feed.xml"}
10 , {url:"https://ianjbattaglia.co"}
10 , {url:"https://ianjbattaglia.co"}
@@ -26,7 +26,7 @@ const sites = [
26 , {url:"https://craze.co.uk"}
26 , {url:"https://craze.co.uk"}
27 , {url:"https://shaneckel.com"}
27 , {url:"https://shaneckel.com"}
28 , {url:"https://cblgh.org"}
28 , {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"}
30 , {url:"http://hur.bet"}
30 , {url:"http://hur.bet"}
31 , {url:"http://chigby.org"}
31 , {url:"http://chigby.org"}
32 , {url:"https://longest.voyage"}
32 , {url:"https://longest.voyage"}