Working commit count
This commit is contained in:
parent
0aaec4181f
commit
737c788c76
3 changed files with 18 additions and 12 deletions
9
index.js
9
index.js
|
@ -181,12 +181,3 @@ app.use((req, res, next) => {
|
|||
<p>Uh oh... I think your lost? There's nothing here :P</p>
|
||||
`)
|
||||
})
|
||||
|
||||
async function updateCommits() {
|
||||
var codebergResponse = await (await fetch(`https://codeberg.org/Bingus_Violet/Violets-Purgatory/src/branch/${process.env.BRANCH || "origin"}`)).text()
|
||||
var commits = codebergResponse.substring(0, codebergResponse.indexOf("Commits"))
|
||||
commits = commits.substring(commits.lastIndexOf("<b>") + 3, commits.lastIndexOf("</b>"))
|
||||
commitCount = commits
|
||||
}
|
||||
|
||||
updateCommits()
|
|
@ -4,6 +4,8 @@ fs = require('fs')
|
|||
var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
|
||||
var highlightedWords = config.highlightedWords
|
||||
|
||||
var commitCount = "300+"
|
||||
|
||||
function makeStars() {
|
||||
var html = ""
|
||||
|
||||
|
@ -49,6 +51,8 @@ function converter(html) {
|
|||
|
||||
html = html.replaceAll("{BG_EFFECT}", makeStars())
|
||||
|
||||
html = html.replaceAll("{COMMIT_COUNT}", commitCount)
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
|
@ -69,3 +73,12 @@ module.exports = { middleWare: function(req, res, next) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function updateCommits() {
|
||||
var codebergResponse = await (await fetch(`https://codeberg.org/Bingus_Violet/Violets-Purgatory/src/branch/${process.env.BRANCH || "origin"}`)).text()
|
||||
var commits = codebergResponse.substring(0, codebergResponse.indexOf("Commits"))
|
||||
commits = commits.substring(commits.lastIndexOf("<b>") + 3, commits.lastIndexOf("</b>"))
|
||||
commitCount = commits
|
||||
}
|
||||
|
||||
updateCommits()
|
|
@ -52,11 +52,13 @@ hr {
|
|||
font-size: 2.75rem;
|
||||
color: rgb(215, 80, 255);
|
||||
display: block;
|
||||
padding-top: 5px;
|
||||
line-height: 2.2rem;
|
||||
}
|
||||
|
||||
.note {
|
||||
color: gray;
|
||||
font-size: 0.9rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@keyframes mainText {
|
||||
|
|
Loading…
Reference in a new issue