diff --git a/.gitignore b/.gitignore index 0b083f7..f0e7a5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /chat/node_modules mastodon-status/* +venv/ +__pycache__/ + diff --git a/.main.py.swp b/.main.py.swp new file mode 100644 index 0000000..ad67f38 Binary files /dev/null and b/.main.py.swp differ diff --git a/ascii/christmas.txt b/ascii/christmas.html similarity index 82% rename from ascii/christmas.txt rename to ascii/christmas.html index a2415f5..243f33a 100644 --- a/ascii/christmas.txt +++ b/ascii/christmas.html @@ -1,3 +1,4 @@ + .-""-. * /,..___\ () {_____} * @@ -17,4 +18,4 @@ / `.`, | '--' `. ( `. __.j ) \_ |--""___| ,-' - `"--...,+"""" `._,.-' mh + `"--...,+"""" `._,.-' mh diff --git a/ascii/hallowe'en.txt b/ascii/halloween.html similarity index 82% rename from ascii/hallowe'en.txt rename to ascii/halloween.html index a07504d..a284ee3 100644 --- a/ascii/hallowe'en.txt +++ b/ascii/halloween.html @@ -1,3 +1,4 @@ + .-J"L-. \--/ ' \ /`-' '-`\ | /\ /\ | / \ @@ -15,4 +16,5 @@ / `.`, .'`" '--'.l ( `. / ^.^ \) \_ |--""\ `===` / - `"--...,+"""" `--------`mh + `"--...,+"""" `--------`mh + diff --git a/ascii/normal.txt b/ascii/normal.html similarity index 80% rename from ascii/normal.txt rename to ascii/normal.html index b4e7890..fdb7f16 100644 --- a/ascii/normal.txt +++ b/ascii/normal.html @@ -1,3 +1,4 @@ + .-"""-. ' \ |,. ,-. | @@ -15,4 +16,5 @@ / `.`, | '--' `. ( `. __.j ) \_ |--""___| ,-' - `"--...,+"""" `._,.-' mh + `"--...,+"""" `._,.-' mh + diff --git a/ascii/singles-day.html b/ascii/singles-day.html new file mode 100644 index 0000000..cd5a65d --- /dev/null +++ b/ascii/singles-day.html @@ -0,0 +1,20 @@ + + .-"""-. + ' \ + |,. ,-. | + |()L () \ | + | ___ | + | ` ` | ` + .j ` `. + / ' ' \ + / / ` `. + / / Stay ` . + / / Single l | + . , TuxCord | | + _ ,"`. .| | + | ' ``. | [..-'l + / `.`, | '--' `. +( `. __.j ) + \_ |--""___| ,-' + `"--...,+"""" `._,.-' mh + diff --git a/main.py b/main.py new file mode 100644 index 0000000..fa6cb53 --- /dev/null +++ b/main.py @@ -0,0 +1,34 @@ +from flask import Flask, render_template, request, redirect +from datetime import datetime + +app = Flask(__name__) + +def decide_ascii(): + day = datetime.today().strftime('%d') + month = datetime.today().strftime('%m') + + if month == "12": + return open(f'./ascii/christmas.html', 'r').read() + if month == "10": + return open(f'./ascii/halloween.html', 'r').read() + else: + return open(f'./ascii/normal.html', 'r').read() + +@app.route('/') +def index(): + ascii_penguin = decide_ascii() + return render_template('index.html', ascii_penguin = ascii_penguin) + +@app.route('/mc') +def mc(): + ascii_penguin = decide_ascii() + return render_template('mc.html', ascii_penguin = ascii_penguin) + + +if __name__ == '__main__': + app.run( + debug = True, + host = "0.0.0.0", + port = 8081 + ) + diff --git a/mc/.index.html.swp b/mc/.index.html.swp new file mode 100644 index 0000000..73d839f Binary files /dev/null and b/mc/.index.html.swp differ diff --git a/index.css b/static/index.css similarity index 100% rename from index.css rename to static/index.css diff --git a/templates/.mc.html.swp b/templates/.mc.html.swp new file mode 100644 index 0000000..5e1aec5 Binary files /dev/null and b/templates/.mc.html.swp differ diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..f2f47dc --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,9 @@ + +
+ + __ __ __ +---------/\ \__ /\ \ /\ \__ +---------\ \ ,_\ __ __ __ _ ___ ___ _ __ \_\ \ ___ __\ \ ,_\ +----------\ \ \/ /\ \/\ \/\ \/'\ /'___\ / __`\/\`'__\/'_` \ /'_ `\ /'__`\ \ \/ +-----------\ \ \_\ \ \_\ \/> <//\ \__//\ \L\ \ \ \//\ \L\ \ __/\ \/\ \/\ __/\ \ \_ +------------\ \__\\ \____//\_/\_\ \____\ \____/\ \_\\ \___,_\/\_\ \_\ \_\ \____\\ \__\ +-------------\/__/ \/___/ \//\/_/\/____/\/___/ \/_/ \/__,_ /\/_/\/_/\/_/\/____/ \/__/ + A friendly Linux community. + +diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..3195eb0 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,68 @@ + + + + {% include 'head.html' %} + + +
+ {{ ascii_penguin|safe }} ++
+ {{ ascii_penguin|safe }} ++