Moving stuff
This commit is contained in:
parent
bede398f0a
commit
a66a3a9198
2 changed files with 15 additions and 15 deletions
15
index.js
15
index.js
|
@ -1,7 +1,8 @@
|
|||
const express = require('express'),
|
||||
path = require('path'),
|
||||
fs = require('fs'),
|
||||
pageUpdater = require('./pageUpdater.js')
|
||||
pageUpdater = require('./pageUpdater.js'),
|
||||
ytjs = require("youtubei.js")
|
||||
|
||||
var app = express()
|
||||
|
||||
|
@ -9,6 +10,7 @@ const PORT = process.env.PORT || 8080
|
|||
|
||||
const staticpath = path.join(__dirname, 'static')
|
||||
|
||||
var mostRecentVideo = undefined
|
||||
var lanyardData = undefined
|
||||
|
||||
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
|
||||
|
@ -22,6 +24,17 @@ function getThumbor() {
|
|||
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, () => {
|
||||
console.log("Violet's Purgatory is now listening on port: " + PORT)
|
||||
})
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
const path = require('path'),
|
||||
fs = require('fs'),
|
||||
WebSocket = require('ws'),
|
||||
minify = require('minify-html'),
|
||||
ytjs = require('youtubei.js')
|
||||
minify = require('minify-html')
|
||||
|
||||
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
|
||||
|
||||
|
@ -10,24 +9,12 @@ var highlightedWords = config.highlightedWords
|
|||
var quotes = config.quotes
|
||||
var titles = config.titles
|
||||
|
||||
var mostRecentVideo = undefined
|
||||
|
||||
var commitCount = "300+"
|
||||
|
||||
var lanyardData = undefined
|
||||
|
||||
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) {
|
||||
if (lanyardData) {
|
||||
var statusData = config.discStatuses[lanyardData.discord_status]
|
||||
|
|
Loading…
Reference in a new issue