Update default config & better date logic

This commit is contained in:
dakedres 2024-01-10 17:06:25 -05:00
parent 5c3f804a14
commit 4053d57438
2 changed files with 19 additions and 10 deletions

View File

@ -1,17 +1,24 @@
const pageSize = 20 const pageSize = 20
const courtesyWait = 1000 const courtesyWait = 1000 * 1
const tooLongAgo = 7 * 2 // Days const tooLongAgo = 7 * 4 // Days
const linkToIndex = false
const printDate = date =>
(date.getMonth() + 1) + '.' + date.getDate() + '.' + date.getFullYear()
const feeds = { const feeds = {
nitter: [], main: {
tumblr: [] main: true,
nitter: [],
tumblr: [
'dakedres'
]
}
} }
const sources = { const sources = {
nitter: [ nitter: [
"nitter.salastil.com",
"nt.ggtyler.dev", "nt.ggtyler.dev",
"nitter.hyperreal.coffee",
"nitter.unixfox.eu", "nitter.unixfox.eu",
"nitter.poast.org", "nitter.poast.org",
"nitter.cz", "nitter.cz",
@ -94,5 +101,7 @@ module.exports = {
sources, sources,
pageSize, pageSize,
courtesyWait, courtesyWait,
tooLongAgo tooLongAgo,
} linkToIndex,
printDate
}

View File

@ -1,5 +1,5 @@
const fetch = require('node-fetch') const fetch = require('node-fetch')
const config = require('./config.js.ignore') const config = require('./config.js')
const Path = require('path') const Path = require('path')
let cache = require('./cache.json') let cache = require('./cache.json')
@ -240,7 +240,7 @@ ${header}
html += ` html += `
${post.images.map(renderImage).join('\n')} ${post.images.map(renderImage).join('\n')}
<p><b>${post.user}</b> ${date.getMonth()}/${date.getDate()}/${date.getFullYear()} <a href="${post.link}">open</a></p><hr>` <p><b>${post.user}</b> ${config.printDate(date)} <a href="${post.link}">open</a></p><hr>`
} }
if(footer) { if(footer) {