"Fix" formatting again on activities ?
This commit is contained in:
parent
5c29e62af7
commit
0312806c99
3 changed files with 7 additions and 32 deletions
27
index.js
27
index.js
|
@ -21,33 +21,6 @@ var fontPath = path.join(staticpath, "fonts")
|
|||
app.use("/fonts", express.static(fontPath))
|
||||
app.use("/cached", express.static(cachePath))
|
||||
|
||||
app.get("/disc", (req, res) => {
|
||||
res.setHeader("X-Accel-Buffering", "no")
|
||||
res.write(fs.readFileSync(path.join(__dirname, "resources/disc.html")))
|
||||
|
||||
var iterations = 0
|
||||
var lastAct = null
|
||||
|
||||
function loop() {
|
||||
var currentAct = pageUpdater.getActivities()
|
||||
if (currentAct != lastAct) {
|
||||
lastAct = currentAct
|
||||
iterations += 1
|
||||
res.write(`<div id="loop${iterations}">`)
|
||||
res.write(currentAct.substring(currentAct.indexOf("<div")))
|
||||
res.write(`</div>`)
|
||||
res.write(`<style>#loop${iterations - 1} {display: none;}</style>`)
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!res.closed) {
|
||||
loop()
|
||||
res.write(" ")
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
loop()
|
||||
})
|
||||
|
||||
if (!fs.existsSync(cachePath)) {
|
||||
fs.mkdirSync(cachePath)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue