1
0
mirror of https://github.com/journey-ad/Moe-Counter.git synced 2024-11-27 17:00:51 +01:00

Initial commit

This commit is contained in:
Jad 2020-08-03 12:11:58 +00:00
commit cbbf373bd7
7 changed files with 1762 additions and 0 deletions

BIN
count.db Normal file

Binary file not shown.

57
db.js Normal file
View File

@ -0,0 +1,57 @@
const sqlite3 = require('sqlite3')
const db = new sqlite3.Database('count.db')
db.run(`CREATE TABLE IF NOT EXISTS tb_count (
id INTEGER PRIMARY KEY AUTOINCREMENT
NOT NULL
UNIQUE,
name VARCHAR (32) NOT NULL
UNIQUE,
num BIGINT NOT NULL
DEFAULT (0)
);`)
function getNum(name) {
return new Promise((resolve, reject) => {
db.get('SELECT `name`, `num` from tb_count WHERE `name` = ?', name, (err, row) => {
if (err) reject(err)
resolve(row || { name, num: 0 })
})
})
}
function getAll(name) {
return new Promise((resolve, reject) => {
db.get('SELECT * from tb_count', (err, row) => {
if (err) reject(err)
resolve(row)
})
})
}
function setNum(name, num) {
return new Promise((resolve, reject) => {
db.run(`INSERT INTO tb_count(\`name\`, \`num\`)
VALUES($name, $num)
ON CONFLICT(name) DO
UPDATE SET \`num\` = $num;`
, {
$name: name,
$num: num
}
, (err, row) => {
if (err) reject(err)
resolve(row)
})
})
}
module.exports = {
getNum,
getAll,
setNum
}

74
index.js Normal file
View File

@ -0,0 +1,74 @@
'use strict'
const fs = require('fs')
const express = require('express')
const compression = require('compression')
const db = require('./db')
const numList = require('./num-list')
const PLACES = 7
function getCountImage(count) {
// This is not the greatest way for generating an SVG but it'll do for now
const countArray = count.toString().padStart(PLACES, '0').split('')
const parts = countArray.reduce((acc, next, index) => `
${acc}
<image x="${index * 45}" y="0" width="45px" height="100px" xlink:href="data:image/gif;base64,${numList[next]}" />
`, '')
return `<?xml version="1.0" encoding="UTF-8"?>
<svg width="${PLACES * 45}" height="100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Kawaii Count</title>
<g>
${parts}
</g>
</svg>
`
}
const app = express()
app.use(compression())
app.set('view engine', 'pug')
app.get('/', (req, res) => {
res.render('index')
});
// get the image
app.get('/get/@:name', async (req, res) => {
const name = req.params.name
if (!name) return
const counter = await db.getNum(name)
const num = counter.num + 1
db.setNum(counter.name, num)
// This helps with GitHub's image cache
res.set({
'content-type': 'image/svg+xml',
'cache-control': 'max-age=0, no-cache, no-store, must-revalidate'
})
// Send the generated SVG as the result
res.send(getCountImage(num))
console.log(counter)
})
app.get('/heart-beat', (req, res) => {
res.set({
'cache-control': 'max-age=0, no-cache, no-store, must-revalidate'
})
res.send('alive')
console.log('heart-beat')
});
const listener = app.listen(process.env.PORT, () => {
console.log('Your app is listening on port ' + listener.address().port)
})

12
num-list.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = {
0: 'R0lGODlhLQBkALMAACocJKGkunN8ntXa6BE1dwxKpTdvw0mq6v7j0vDWzOGFgLZtauGjov7+/gAAAP///yH5BAEAAA8ALAAAAAAtAGQAAAT/8MlJq7046827p04ohl8pjU2qCoJoco7aFEZtF2zrvmCcFgWZDJgTBBy8RygVmAmfs+IRWfI1mtAsC8BKUWFWrEwsXm27DZLGen2W340iV6D6Wthx4RseP6PTF3h5KgFvCzKHfX50V3ZKAUU5hUyJlIQLTXIAm5wAjiKRk1cKY5UBC6SanZ4ZIYVGTacMY6SUqTmramsOsKOztpcKkLibuh0OkwIKv1eowcNbrCa8mUDWBagB1wWbZ44eDgCZDOTl5udzXN/H4nGrCfDwq+ktL7xcDQAD1gPx8PtABtBbt+HelgYEEjZAwJAhQoUD7QkQN7HWwoYNVSiIOG1iLAYK/0JibBhyGccqHpvFG8kw3oKT4EIYaTSiZk1cxo6lmFkmi5mJgKrsjOXziRGgBDE4MLCsTc+iR0MmvdNwFtGiMugIYKhgKggE5EhdxcrkijmvShhUdSqjphuzDBmgdaCWK9s6KPTARdAVBjm7V/OmYfOx5dxyiQKLwDvGF4IEaJUYYHSliWAvi5k0QdX3WBjLmfEu0ZxiQeQJgi4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8ucTmP5Nvlo78enbXziVCN05husXG4rFb3M2duvjrzt07Lo6ic+v32N2Dp2/Cgc7n1jn33f9oBDRAXlQIjCaga7a11thtAxzoAGwghbSgRRhGeMKE98F3G4YYkvdDgxiSONqA0ZlVT4PUGUBiPTDGeNoPMDYYnIutxagjYTTGaGNjmhnAQEEF6QgAEOQ4oJSONpLW2F586diAgZJBmUCM2D1ngJVsxTgllazQhaWAt9GVAAMwfgkmHHQpACNprJUJVlv1qLlmFmsVWc9wt0HZVmN23nlGWAwI9lFzgaoJaKIaKUlkoV+Cd4UDDUDKKCttpcUApXZOmqiaP8CRaVqcTmlEp0B8amA8SmpKKqip3rbqD6o6gU2rrpY6K6WynlpgoLZmMeqmsNL6k1GnDsBoqGe4WqjCrqcWSylowAYbkJG6mjoppY5VW5YPMe5WrafJ/frlD99GVWFI4qp6bqogUftuug7o1667u7KUIKz0dnjvp9Hqa+6q/WZoGr6+iueiuej64p/B2e6a6pQYksawteX5ezCqVOAE4mvzCuJfh45F/Cl66dEWcgX+6UcAAiYn2tiDcRplalQBoVgyvl/mFGfN52YhGoZHxpzozxAGfYaRERodqM/PAaDszWcMAOMpQWxrhY5NI3lGLTDP+JuGSTJLAhYYRAAAOw=='
}

1574
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "kawaii-counter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"compression": "^1.7.4",
"express": "^4.17.1",
"pug": "^3.0.0",
"sqlite3": "^5.0.0"
}
}

26
views/index.pug Normal file
View File

@ -0,0 +1,26 @@
html
head
title='Kawaii Counter!'
meta(name='viewport', content='width=device-width, initial-scale=1')
link(rel='stylesheet',href='https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/light.min.css')
body
h4 How to use:
h5 SVG address
code.
https://count.getloli.com/get/@:name
h5 Img tag
code.
&lt;img src="https://count.getloli.com/get/@:name" alt=":name" />
h5 Markdown
code.
[:name](https://count.getloli.com/get/@:name)
h4 eg:
<img src="https://count.getloli.com/get/@index" alt="Kawaii Count!" />
p.copy
a(href='')