diff --git a/api.js b/api.js index 8605a92..ab08787 100644 --- a/api.js +++ b/api.js @@ -14,9 +14,6 @@ module.exports = { "connected": false, "lastLanyardUpdate": Date.now(), - "blogConnected": false, - "blogPosts": undefined, - "events": events, "spins": 0, @@ -72,54 +69,4 @@ function socketeer() { }) } -socketeer() - -function blogSocket() { - var blog = new WebSocket('https://blog.violets-purgatory.dev') - - blog.on("error", (error) => { - console.log(error) - }) - - blog.on("close", () => { - console.log("Connection Closed. Attempting Reconnect in 30 seconds.") - module.exports.blogConnected = false - setTimeout(() => { - blogSocket() - }, 30000); - }) - - function ping(dur) { - blog.send(JSON.stringify({ - type: "ping" - })) - setTimeout(() => { - ping(dur) - if (Date.now() - lastPong > 120000) { - blog.close() - console.log("Max duration since last pong exceeded- Closing socket.") - } - }, dur); - } - - blog.addEventListener("message", async (res) => { - var data = JSON.parse(res.data) - if (data.type == "init") { - console.log("Connected to Blog Websocket!") - module.exports.blogConnected = true - ping(30000) - lastPong = Date.now() - events.emit("blogConnect") - } else if (data.type == "ping") { - lastPong = Date.now() - } else if (data.type == "allPosts") { - console.log("Recieved posts!") - module.exports.blogPosts = data.data - events.emit("blogUpdate") - } else { - console.log(data) - } - }) -} - -blogSocket() \ No newline at end of file +socketeer() \ No newline at end of file diff --git a/assets/fonts/encode-sans-expanded-v11-latin-regular.woff2 b/assets/fonts/encode-sans-expanded-v11-latin-regular.woff2 deleted file mode 100644 index dbdfceb..0000000 Binary files a/assets/fonts/encode-sans-expanded-v11-latin-regular.woff2 and /dev/null differ diff --git a/assets/fonts/source-code-pro-v23-latin-regular.woff2 b/assets/fonts/source-code-pro-v23-latin-regular.woff2 deleted file mode 100644 index b62bc79..0000000 Binary files a/assets/fonts/source-code-pro-v23-latin-regular.woff2 and /dev/null differ diff --git a/assets/html/blog.html b/assets/html/blog.html deleted file mode 100644 index cf0f2e6..0000000 --- a/assets/html/blog.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - {BLOG_TITLE} - Violet's Purgatory - - - - - - - - - - - {TOPBAR} -

{BLOG_TITLE}

-
- {BLOG_POST} -
- - - \ No newline at end of file diff --git a/blog.js b/blog.js deleted file mode 100644 index 1170630..0000000 --- a/blog.js +++ /dev/null @@ -1,36 +0,0 @@ -const api = require("./api.js"), -app = require("./expressHandler.js").app, -showdown = require("showdown"), -pageUpdater = require("./pageUpdater.js"), -fs = require("fs"), -path = require("path") -mkhtml = new showdown.Converter() - -mkhtml.setFlavor("github") - -app.use((req, res, next) => { - if (req.path.includes("blog") && api.blogPosts) { - var postName = decodeURIComponent(req.path.substring(6, req.path.length - 1)) - for (var i = 0; i < api.blogPosts.length; i++) { - var post = api.blogPosts[i] - - if (post.folder == postName || post.folder == decodeURIComponent(post.title)) { - var mkdwn = post.data - var html = mkhtml.makeHtml(mkdwn) - - html = fs.readFileSync(path.join(__dirname, "assets/html/blog.html")).toString().replace("{BLOG_POST}", html) - - html = pageUpdater.converter(html, false) - - html = html.replaceAll("{BLOG_TITLE}", post.title) - html = html.replaceAll("{BLOG_DESC}", post.desc) - - res.send(html) - return - } - } - next() - } else { - next() - } -}) \ No newline at end of file diff --git a/constants.json b/constants.json index 02da0b6..1e25c94 100644 --- a/constants.json +++ b/constants.json @@ -142,29 +142,10 @@ "enby", - "Slay the Spire", - - "Liberapay", - - "Golden Wind" + "Slay the Spire" ], "color": "yellow" }, - { - "words": [ - "brain" - ], - "color": "pink", - "caseInsensitive": true - }, - { - "words": [ - "Jojo's Bizarre Adventure", - "Jojo" - ], - "caseInsensitive": true, - "color": "rgb(170, 80, 225)" - }, { "words": [ "Teto Tuesday", @@ -202,7 +183,6 @@ "words": [ "Forgejo", "HTML", - ".html", "Shortcat", "Valve", "Spooky", @@ -255,26 +235,21 @@ }, { "words": [ - "Codeberg", - - "TrueNAS" + "Codeberg" ], "color": "rgb(0, 255, 255)" }, { "words": [ - "Code", - "Codium" + "Code" ], "color": "rgb(150, 175, 255)" }, { "words": [ - ".md", - "Markdown", - "markdown" + "Codium" ], - "color": "rgb(150, 200, 255)" + "color": "rgb(150, 175, 255)" }, { "words": [ @@ -346,6 +321,12 @@ "color": "rgb(150, 220, 255)", "caseInsensitive": true }, + { + "words": [ + "Liberapay" + ], + "color": "yellow" + }, { "words": [ "Roblox" diff --git a/index.js b/index.js index a68365e..f18948c 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,6 @@ const fs = require("fs") require("./fileHandler.js") require('./expressHandler.js') -require("./pageUpdater.js") -require("./blog.js") // require("./imageEmbedder.js") process.on('uncaughtException', (err, origin) => { diff --git a/overcomplicatedStatuses.js b/overcomplicatedStatuses.js index a7a4705..0c9786d 100644 --- a/overcomplicatedStatuses.js +++ b/overcomplicatedStatuses.js @@ -95,7 +95,7 @@ module.exports = { var currentPercent = (Date.now() - activity.timestamps.start) / (activity.timestamps.end - activity.timestamps.start) * 100 return `
- ${timeFormatter((Date.now() - activity.timestamps.start))}/${timeFormatter((activity.timestamps.end - activity.timestamps.start))} + ${timeFormatter((Date.now() - activity.timestamps.start))}/${timeFormatter((activity.timestamps.end - activity.timestamps.start))}