on master help sign in
Added extractor
78ebd8cneauoire
scripts/hallway.js+1−1
@@ -215,7 +215,7 @@ function escapeHtml (unsafe) {
215 return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;')
215 return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;')
216}
216}
217
217
218−function cleanTags (unsafe){
218+function cleanTags (unsafe) {
219 return unsafe.replace(/([^a-z0-9]+)/gi, '-')
219 return unsafe.replace(/([^a-z0-9]+)/gi, '-')
220}
220}
221
221
scripts/portal.js+4−4
@@ -18,11 +18,11 @@ function Portal (sites) {
18
18
19 const siteTypes = siteTypesArray.reduce((output, siteType) =>
19 const siteTypes = siteTypesArray.reduce((output, siteType) =>
20 `${output}<a data-type="${siteType}" href="#" onclick="filterSites(event)">&lt;${siteType}&gt;</a>`,
20 `${output}<a data-type="${siteType}" href="#" onclick="filterSites(event)">&lt;${siteType}&gt;</a>`,
21− '<a class="currentType" data-type="all" href="#" onclick="filterSites(event)">&lt;all&gt;</a>')
21+ '<a class="currentType" data-type="all" href="#" onclick="filterSites(event)">&lt;all&gt;</a>')
22
22
23 const siteLangs = siteLangsArray.reduce((output, siteLang) =>
23 const siteLangs = siteLangsArray.reduce((output, siteLang) =>
24 `${output}<a data-lang="${siteLang}" href="#" onclick="filterSites(event)">&lt;${siteLang}&gt;</a>`,
24 `${output}<a data-lang="${siteLang}" href="#" onclick="filterSites(event)">&lt;${siteLang}&gt;</a>`,
25− '<a class="currentLang" data-lang="all" href="#" onclick="filterSites(event)">&lt;all&gt;</a>')
25+ '<a class="currentLang" data-lang="all" href="#" onclick="filterSites(event)">&lt;all&gt;</a>')
26
26
27 const listItems = sites.reduce((acc, site, id) =>
27 const listItems = sites.reduce((acc, site, id) =>
28 `${acc}<li ${_type(site)} ${_lang(site)} id='${id}'><a href='${site.url}'>${_name(site)}</a></li>`, '')
28 `${acc}<li ${_type(site)} ${_lang(site)} id='${id}'><a href='${site.url}'>${_name(site)}</a></li>`, '')
@@ -30,7 +30,7 @@ function Portal (sites) {
30 }
30 }
31
31
32 function _name (site) {
32 function _name (site) {
33− return site.title || `${site.url.split('//')[1].replace(/\/+$/,'')}`
33+ return site.title || `${site.url.split('//')[1].replace(/\/+$/, '')}`
34 }
34 }
35
35
36 function _type (site) {
36 function _type (site) {
@@ -71,7 +71,7 @@ function Portal (sites) {
71 setTimeout(() => { window.location.href = target }, 3000)
71 setTimeout(() => { window.location.href = target }, 3000)
72 }
72 }
73
73
74− this.navLangs = [... new Set(navigator.languages.map(lang => lang.split('-').shift()))]
74+ this.navLangs = [...new Set(navigator.languages.map(lang => lang.split('-').shift()))]
75
75
76 this.sitesMatchingLangs = this.sites
76 this.sitesMatchingLangs = this.sites
77 .filter(site => site.langs && site.langs.some(lang => this.navLangs.includes(lang)))
77 .filter(site => site.langs && site.langs.some(lang => this.navLangs.includes(lang)))
scripts/sites.js+12−8
@@ -719,7 +719,7 @@ const sites = [
719 contact: 'roy@royniang.com',
719 contact: 'roy@royniang.com',
720 feed: 'https://telecom.royniang.com/updates.txt',
720 feed: 'https://telecom.royniang.com/updates.txt',
721 langs: ['en'],
721 langs: ['en'],
722− title: 'roy niang',
722+ title: 'roy niang',
723 type: 'portfolio',
723 type: 'portfolio',
724 url: 'https://royniang.com',
724 url: 'https://royniang.com',
725 wiki: 'https://telecom.royniang.com/usefulnotes.ndtl'
725 wiki: 'https://telecom.royniang.com/usefulnotes.ndtl'
@@ -729,7 +729,7 @@ const sites = [
729 author: 'raul altosaar',
729 author: 'raul altosaar',
730 contact: 'raul.altosaar@gmail.com',
730 contact: 'raul.altosaar@gmail.com',
731 langs: ['en'],
731 langs: ['en'],
732− title: 'raul altosaar',
732+ title: 'raul altosaar',
733 type: 'portfolio',
733 type: 'portfolio',
734 url: 'https://www.raul.earth/'
734 url: 'https://www.raul.earth/'
735 },
735 },
@@ -810,10 +810,10 @@ const sites = [
810 type: 'hybrid',
810 type: 'hybrid',
811 url: 'https://parkimminent.com'
811 url: 'https://parkimminent.com'
812 },
812 },
813−
813+
814 {
814 {
815 author: 'aklsh',
815 author: 'aklsh',
816− contact:'akileshkannan@gmail.com',
816+ contact: 'akileshkannan@gmail.com',
817 langs: ['en'],
817 langs: ['en'],
818 url: 'https://aklsh.github.io',
818 url: 'https://aklsh.github.io',
819 type: 'hybrid'
819 type: 'hybrid'
@@ -835,7 +835,7 @@ const sites = [
835 type: 'portfolio',
835 type: 'portfolio',
836 url: 'https://simone.computer'
836 url: 'https://simone.computer'
837 },
837 },
838−
838+
839 {
839 {
840 author: 'xj9',
840 author: 'xj9',
841 contact: 'xj9@sunshinegardens.org',
841 contact: 'xj9@sunshinegardens.org',
@@ -847,7 +847,7 @@ const sites = [
847 url: 'https://xj9.io',
847 url: 'https://xj9.io',
848 wiki: 'https://xj9.io/.well-known/webring/wiki.ndtl'
848 wiki: 'https://xj9.io/.well-known/webring/wiki.ndtl'
849 },
849 },
850−
850+
851 {
851 {
852 contact: 'joe.jenett@jenett.org',
852 contact: 'joe.jenett@jenett.org',
853 langs: ['en'],
853 langs: ['en'],
@@ -856,7 +856,7 @@ const sites = [
856 type: 'blog',
856 type: 'blog',
857 url: 'https://simply.personal.jenett.org'
857 url: 'https://simply.personal.jenett.org'
858 },
858 },
859−
859+
860 {
860 {
861 author: 'Wally',
861 author: 'Wally',
862 contact: 'qpfiffer+xxiivvwebring@gmail.com',
862 contact: 'qpfiffer+xxiivvwebring@gmail.com',
@@ -865,7 +865,7 @@ const sites = [
865 type: 'blog',
865 type: 'blog',
866 url: 'http://q.pfiffer.org/'
866 url: 'http://q.pfiffer.org/'
867 },
867 },
868−
868+
869 {
869 {
870 author: 'ashpex',
870 author: 'ashpex',
871 contact: 'ashpex@dismail.de',
871 contact: 'ashpex@dismail.de',
@@ -883,3 +883,7 @@ No trailing slashes or commas!
883Alphabetize your keys!
883Alphabetize your keys!
884protocol://url.domain.ext
884protocol://url.domain.ext
885*/
885*/
886+
887+if (module && module.exports) {
888+ module.exports = sites
889+}
tools/extract_twtxt.jsnew file+22
@@ -0,0 +1,22 @@
1+'use strict'
2+
3+// extract twtxt feeds from sites.js
4+
5+const fs = require('fs')
6+const sites = require('../scripts/sites.js')
7+const record = { following: {} }
8+
9+for (const site of sites) {
10+ if (!site.author || !site.feed) { continue }
11+ record.following[site.author] = site.feed
12+}
13+
14+const json = JSON.stringify(record)
15+
16+fs.writeFile('twtxt.json', json, 'utf8', (err) => {
17+ if (err) {
18+ console.log('An error occured while writing JSON Object to File.')
19+ return console.log(err)
20+ }
21+ console.log('Done.')
22+})
tools/twtxt.jsonnew file+1
@@ -0,0 +1 @@
1+{"following":{"neauoire":"https://wiki.xxiivv.com/twtxt.txt","rho":"https://electro.pizza/twtxt.txt","joshavanier":"https://avanier.now.sh/tw.txt","kaemura":"https://kaemura.com/twttxt.txt","slisne":"https://liamcooke.com/merveilles/tw.txt","xvw":"https://xvw.github.io/twtxt/hallway.txt","lectronice":"https://lectronice.com/hallway/twtxt.txt","cblgh":"https://cblgh.org/twtxt.txt","jda0":"https://2d4.dev/tw.txt","wakest":"https://wake.st/twtxt.txt","drisc":"https://drisc.io/hallway/twtxt.txt","setphen":"https://phse.net/twtxt/merv.txt","kodedninja":"https://t.seed.hex22.org/twtxt.txt","m":"https://mboxed.github.io/sodatsu/tw.txt","tomupom":"https://a.tom.org.nz/twtxt.txt","teknari":"https://teknari.com/feed.xml","amorris":"https://feed.amorris.ca/hallway.txt","stuartpb":"https://twtxt.stuartpb.com/xxiivv.txt","serocell":"https://xxiii.co/twtxt.txt","kormyen":"https://kor.nz/twtxt.txt","quite":"https://lublin.se/twtxt.txt","eli_oat":"https://txt.eli.li/twtxt/twtxt.txt","azlen":"https://azlen.me/twtxt.txt","vega":"https://opinionatedguide.github.io/twtxt.txt","cmaughan":"https://chrismaughan.com/twtxt.txt","Fundor 333":"https://fundor333.com/twtxt.txt","dcb":"https://dotcomboom.somnolescent.net/twtxt.txt","icyphox":"https://icyphox.sh/twtxt.txt","roy niang":"https://telecom.royniang.com/updates.txt","eti":"https://y.eti.tf/twtxt.txt","Payson Wallach":"https://paysonwallach.com/blog/feed.xml","icco":"https://writing.natwelch.com/feed.atom","xj9":"https://xj9.io/.well-known/webring/tw.txt"}}