Moving stuff

This commit is contained in:
Bingus_Violet 2024-02-13 13:21:53 -06:00
parent bede398f0a
commit a66a3a9198
2 changed files with 15 additions and 15 deletions

View file

@ -1,7 +1,8 @@
const express = require('express'), const express = require('express'),
path = require('path'), path = require('path'),
fs = require('fs'), fs = require('fs'),
pageUpdater = require('./pageUpdater.js') pageUpdater = require('./pageUpdater.js'),
ytjs = require("youtubei.js")
var app = express() var app = express()
@ -9,6 +10,7 @@ const PORT = process.env.PORT || 8080
const staticpath = path.join(__dirname, 'static') const staticpath = path.join(__dirname, 'static')
var mostRecentVideo = undefined
var lanyardData = undefined var lanyardData = undefined
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json'))) var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
@ -22,6 +24,17 @@ function getThumbor() {
return thumborInstances[thumbCount % thumborInstances.length] + "unsafe" return thumborInstances[thumbCount % thumborInstances.length] + "unsafe"
} }
async function getMostRecentVid() {
innertube = await ytjs.Innertube.create()
var video = await (await (await ytjs.Innertube.create()).getChannel('UChcrBJNJLZucy3TPyGyAY2g'))
video = video.current_tab.content.contents[1].contents[0].content.items[0]
mostRecentVideo = video.endpoint.payload.videoId
console.log(mostRecentVideo)
}
getMostRecentVid()
app.listen(PORT, () => { app.listen(PORT, () => {
console.log("Violet's Purgatory is now listening on port: " + PORT) console.log("Violet's Purgatory is now listening on port: " + PORT)
}) })

View file

@ -1,8 +1,7 @@
const path = require('path'), const path = require('path'),
fs = require('fs'), fs = require('fs'),
WebSocket = require('ws'), WebSocket = require('ws'),
minify = require('minify-html'), minify = require('minify-html')
ytjs = require('youtubei.js')
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json'))) var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
@ -10,24 +9,12 @@ var highlightedWords = config.highlightedWords
var quotes = config.quotes var quotes = config.quotes
var titles = config.titles var titles = config.titles
var mostRecentVideo = undefined
var commitCount = "300+" var commitCount = "300+"
var lanyardData = undefined var lanyardData = undefined
var uptime = Date.now() var uptime = Date.now()
async function getMostRecentVid() {
innertube = await ytjs.Innertube.create()
var video = await (await (await ytjs.Innertube.create()).getChannel('UChcrBJNJLZucy3TPyGyAY2g'))
video = video.current_tab.content.contents[1].contents[0].content.items[0]
mostRecentVideo = video
}
getMostRecentVid()
function converter(html) { function converter(html) {
if (lanyardData) { if (lanyardData) {
var statusData = config.discStatuses[lanyardData.discord_status] var statusData = config.discStatuses[lanyardData.discord_status]