mirror of
https://github.com/Xevion/thedrank.com.git
synced 2025-12-10 14:08:56 -06:00
viewcounter addition
This commit is contained in:
@@ -3,9 +3,16 @@ from flask import render_template
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
i = int(open(os.path.join('app', 'static', 'viewcount.dat'), 'r').read())
|
||||||
|
def getIncrement(n=1):
|
||||||
|
global i
|
||||||
|
i += n
|
||||||
|
open(os.path.join, 'w').write(str(i))
|
||||||
|
return i
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template('index.html')
|
return render_template('index.html', viewcount=getIncrement())
|
||||||
|
|
||||||
@app.route('/keybase.txt')
|
@app.route('/keybase.txt')
|
||||||
@app.route('/.well-known/keybase.txt')
|
@app.route('/.well-known/keybase.txt')
|
||||||
|
|||||||
1
app/static/viewcount.dat
Normal file
1
app/static/viewcount.dat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
|
{{ viewcount }} idiots have bare witness to my worst creation yet
|
||||||
|
<br>
|
||||||
i don't know how to program html
|
i don't know how to program html
|
||||||
<br>
|
<br>
|
||||||
Xevion#0001 if you know how tf i can make this meme site real lmao
|
Xevion#0001 if you know how tf i can make this meme site real lmao
|
||||||
|
|||||||
Reference in New Issue
Block a user