on master help sign in
Catch CORS errors
262cbf6Devine Lu Linvega
scripts/hallway.js+5−2
@@ -57,7 +57,7 @@ function Hallway (sites) {
57 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
57 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
58 const highlight = filter == entry.author.toLowerCase()
58 const highlight = filter == entry.author.toLowerCase()
59
59
60− return `<li class='entry ${highlight ? 'highlight' : ''}'><span class='date'>${timeAgo(Date.parse(entry.date))}</span> <span class='author'>${entry.author}</span> <span class='body'>${entry.body}</span></li>`
60+ return `<li class='entry ${highlight ? 'highlight' : ''}'><span class='date'>${timeAgo(Date.parse(entry.date))}</span> <a class='author' href=''>${entry.author}</a> <span class='body'>${entry.body}</span></li>`
61 }
61 }
62
62
63 // Feeds
63 // Feeds
@@ -82,9 +82,12 @@ function Hallway (sites) {
82
82
83 this.fetchFeed = function (id, feed) {
83 this.fetchFeed = function (id, feed) {
84 console.log(`Fetching ${id}(${feed.path})..`)
84 console.log(`Fetching ${id}(${feed.path})..`)
85+
85− Promise.all([ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()) ]).then(([content]) => {
86+ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()).then((content) => {
86 feeds[id].content = parseFeed(id, content)
87 feeds[id].content = parseFeed(id, content)
87 this.refresh()
88 this.refresh()
89+ }).catch((err) => {
90+ console.warn(`${id}`, err)
88 })
91 })
89 }
92 }
90
93
scripts/sites.js+1−1
@@ -55,7 +55,7 @@ const sites = [
55 { url: 'http://npisanti.com', title: 'npisanti.com', author: 'Nicola Pisanti', contact: 'nicola@npisanti.com', rss: 'http://npisanti.com/journal/rss.xml' },
55 { url: 'http://npisanti.com', title: 'npisanti.com', author: 'Nicola Pisanti', contact: 'nicola@npisanti.com', rss: 'http://npisanti.com/journal/rss.xml' },
56 { url: 'https://underscorediscovery.ca' },
56 { url: 'https://underscorediscovery.ca' },
57 { url: 'https://drisc.io', title: 'drisc.io', type: 'wiki', author: 'Cory Driscoll', contact: 'cory@drisc.io', feed: 'https://drisc.io/hallway/twtxt.txt' },
57 { url: 'https://drisc.io', title: 'drisc.io', type: 'wiki', author: 'Cory Driscoll', contact: 'cory@drisc.io', feed: 'https://drisc.io/hallway/twtxt.txt' },
58− { url: 'https://neufv.systems', author: 'Nuel van Gelder de Neufville', feed: 'https://neufv.systems/twtxt.txt'},
58+ { url: 'https://neufv.systems', author: 'Nuel van Gelder de Neufville', feed: 'https://neufv.systems/twtxt.txt' },
59 { url: 'https://ricky.codes' },
59 { url: 'https://ricky.codes' },
60 { url: 'https://maxdeviant.com' },
60 { url: 'https://maxdeviant.com' },
61 { url: 'https://tynandebold.com' },
61 { url: 'https://tynandebold.com' },