From 91bc65134b730d42755898c46a3f7e2c69757079 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 22 Sep 2019 15:10:43 -0500 Subject: [PATCH] viewcounter addition --- app/routes.py | 9 ++++++++- app/static/viewcount.dat | 1 + app/templates/index.html | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/static/viewcount.dat diff --git a/app/routes.py b/app/routes.py index d1ce119..150183b 100644 --- a/app/routes.py +++ b/app/routes.py @@ -3,9 +3,16 @@ from flask import render_template import os 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('/') def index(): - return render_template('index.html') + return render_template('index.html', viewcount=getIncrement()) @app.route('/keybase.txt') @app.route('/.well-known/keybase.txt') diff --git a/app/static/viewcount.dat b/app/static/viewcount.dat new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/app/static/viewcount.dat @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index 2ce633a..73f9855 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,5 +1,7 @@ + {{ viewcount }} idiots have bare witness to my worst creation yet +
i don't know how to program html
Xevion#0001 if you know how tf i can make this meme site real lmao