on master help sign in
Catch CORS errors
commit262cbf64fe03f41c8a9a0f4082d7c69b666298f9 authorDevine Lu Linvega <aliceffekt@gmail.com> dateWed 3 Jul 2019, 07:48 (7 years ago) parent26efea3
2 files changed+6−3
scripts/hallway.js+5−2 scripts/sites.js+1−1
scripts/hallway.js+5−2
@@ -57,7 +57,7 @@ function Hallway (sites) {
5757 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
5858 const highlight = filter == entry.author.toLowerCase()
5959
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>`
6161 }
6262
6363 // Feeds
@@ -82,9 +82,12 @@ function Hallway (sites) {
8282
8383 this.fetchFeed = function (id, feed) {
8484 console.log(`Fetching ${id}(${feed.path})..`)
85− Promise.all([ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()) ]).then(([content]) => {
85+
86+ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()).then((content) => {
8687 feeds[id].content = parseFeed(id, content)
8788 this.refresh()
89+ }).catch((err) => {
90+ console.warn(`${id}`, err)
8891 })
8992 }
9093
scripts/sites.js+1−1
@@ -55,7 +55,7 @@ const sites = [
5555 { url: 'http://npisanti.com', title: 'npisanti.com', author: 'Nicola Pisanti', contact: 'nicola@npisanti.com', rss: 'http://npisanti.com/journal/rss.xml' },
5656 { url: 'https://underscorediscovery.ca' },
5757 { 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' },
5959 { url: 'https://ricky.codes' },
6060 { url: 'https://maxdeviant.com' },
6161 { url: 'https://tynandebold.com' },