on master help sign in
Better parsing for timezone offset
1997971Devine Lu Linvega
scripts/hallway.js+4−3
@@ -74,7 +74,7 @@ function Hallway (sites) {
74
74
75 this.fetchFeed = function (id, feed) {
75 this.fetchFeed = function (id, feed) {
76 console.log(`Fetching ${id}(${feed.path})..`)
76 console.log(`Fetching ${id}(${feed.path})..`)
77− Promise.all([ fetch(feed.path + '?v=1', { cache: 'no-store' }).then(x => x.text()) ]).then(([content]) => {
77+ Promise.all([ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()) ]).then(([content]) => {
78 feeds[id].content = parseFeed(id, content)
78 feeds[id].content = parseFeed(id, content)
79 this.refresh()
79 this.refresh()
80 })
80 })
@@ -98,8 +98,9 @@ function Hallway (sites) {
98 for (const id in lines) {
98 for (const id in lines) {
99 const line = lines[id].trim()
99 const line = lines[id].trim()
100 if (line === '') { continue }
100 if (line === '') { continue }
101+ const parts = line.replace(' ', '\t').split('\t')
101− const date = line.substr(0, 25).trim()
102+ const date = parts[0].trim()
102− const body = line.substr(26).trim()
103+ const body = parts[1].trim()
103 entries.push({ date, body, author })
104 entries.push({ date, body, author })
104 }
105 }
105 return entries
106 return entries