From ddf4caba621ced7c0b715de50eadc55df864d97e Mon Sep 17 00:00:00 2001 From: deadvey Date: Tue, 21 Oct 2025 23:28:37 +0100 Subject: [PATCH] Made a flask server thing, gonna port it to django though ig. --- .gitignore | 3 + .main.py.swp | Bin 0 -> 12288 bytes ascii/{christmas.txt => christmas.html} | 3 +- ascii/{hallowe'en.txt => halloween.html} | 4 +- ascii/{normal.txt => normal.html} | 4 +- ascii/singles-day.html | 20 +++++++ main.py | 34 ++++++++++++ mc/.index.html.swp | Bin 0 -> 12288 bytes index.css => static/index.css | 0 templates/.mc.html.swp | Bin 0 -> 12288 bytes templates/footer.html | 9 +++ templates/head.html | 3 + templates/header.html | 13 +++++ templates/index.html | 68 +++++++++++++++++++++++ templates/mc.html | 46 +++++++++++++++ 15 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 .main.py.swp rename ascii/{christmas.txt => christmas.html} (82%) rename ascii/{hallowe'en.txt => halloween.html} (82%) rename ascii/{normal.txt => normal.html} (80%) create mode 100644 ascii/singles-day.html create mode 100644 main.py create mode 100644 mc/.index.html.swp rename index.css => static/index.css (100%) create mode 100644 templates/.mc.html.swp create mode 100644 templates/footer.html create mode 100644 templates/head.html create mode 100644 templates/header.html create mode 100644 templates/index.html create mode 100644 templates/mc.html 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 0000000000000000000000000000000000000000..ad67f3808bbc3d5df64051ab36d3841b795f7cf5 GIT binary patch literal 12288 zcmYc?2=nw+u+%eTU|?VnU|{fJ|B;E6&XJA;y&%m&hpMjyDpMjx|pMjx@pMfEOpMgPzpMgP{ zpMimwpMl{L9|OZ4J_d$HJ_d$zJ_ZJRJ_ZImJ_ZIoJ_ZIwJ_d$=ybKK6co`VB@-i?i z=4D`*$;-e{#>>E9$jiWBz{|j(&&$9d!pp$G&db2?mWP4i91jD-Rvre1^)NRL!7v?l z@@NQ*hQMeDjE2By2#kinXb6mkz-S1Jh5%JUKtVx4L6ZSQ!f-);QHg@Bf`WyCg&~Rr zXhAYaLdif643%_Hq*GFpO4Ai=6+((iQz0^m1qFIVrFj|*nQ02~@p*~4sqyg&wzdlD z@$sPb$?@^(RtyYaGm276N{jLoic<4ZQj6kCQgaJ(5=&Aw)N_;dGD>oD)O8dRi<2`m z;|o&r(n~Y*6l_uX5D%a$Nl8u4Oi7Ig3u|aHq@<=P<*BK8xD3fmQ^?KFE6D&wl#-!=5+MVVGm0{cOL7y7i8Ihh z$qEwMP)ih25=&A`GILY)O7c?@D>XFric5;pKmr=-s=4YAkEJA5D%j#xnW7GfVAMFb zVqi!tC{VCfaLY+7&enjXK}`mRw4(f6xPc0px!^<(a|%Q@4WtJq1vWqjJ%NG*3QJRq OOF)d2%%arf5(WVF>o?>8 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..73d839fa1bef3e77974744f151cbe9e6b57b4927 GIT binary patch literal 12288 zcmYc?2=nw+u+%eTU|?VnU|=v}_?GdJOORob7Xw2|YGO)RY9&YpFV4wNPRz;3FD}so zvr_VN6EpL$=%|AlsPCMglB!=)T9KSzl%kiHTB4tute=^el3JmcQIea3Mdzr{Xb6m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0RAtSLYRUuKKC^bE^xTGktBr`uxp}4ZRBsEtLW)+eR8HvRTi3;TznI)+?nZ+ew zYqIh)^Az$+i%`oAP}!T3Sqxqto1U&89N*`WjQm$m@0ucrk5IUHeauZ96GAr~- z^7WPV6`fow-J<-X3c`c(gNibOypjs6pz`@e=}LCKV6`BFK=BVRw=#>8t@QOXi;__b zY%~F|Hc+f47H5OKnwh3hnO~}qoS3Ho_ETmaIB_WJp{ zEVZaOGe6Ht!BEf8NY4Un3pXMlb%Bw0G9q!gtV7h5UhqBsVo&@VAJ)k+}*vW!^Q z*BK%X&S2n-2+9eZoSd8r3XTeCMVYC2DLIu2KACx?6$;7uxw)lznI)Ba47$i5Mn67Y zUjamdDg7Azco2?{hf?|qAW4V{op=S195M!}11X5t2Zaxc(J=}!@$oTWGCp2kKPFy3 zCLYRzQu-hoszN6|1}YC01nGt8jzKmyMgc0X05(nEPC-E}r^H$xY!=8Gg%}^O8ig3J z7?`5~@{K|aNR57s0+a`;Y>-R_YtmPMs)49gk5SN9kB^U!QP5Y2k57ovk4aFEkB`w; zk55pD0TqP`AbEv^7%&~505wAaVJt{QCmw7k$X+N`0MX#8E zxETmzL9PU8fvLtvgVbV^2Z@8t0F~-s1~ye##BiyFiG$K3tX-wAqyViJ^73_y3o`Q{ zO%HHt<+OpeH*EAXQWH}^^@0tkd7@C1nq#X}TvC~nTAY!ZTA~DPqd^zUCl^E8FS)5D piJ&Z2RGeC3s}vgIrfZ?30B+JijI)6>{cIFn{GCH016&m#d;lg40q6h# literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5e1aec59515a3d9575e5be0bc24eb3f49487020f GIT binary patch literal 12288 zcmYc?2=nw+u+%eTU|?VnU|`^6|B*4tSCCQSdv<-pPQ_gQIea3Mfa%C zXb6mk0A(S-%V2C|XaF)pSxHerSSS?49L1v{Fd71*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ur*ovnRyEN zr9}!hi3%A-scE)K86_nJ#a8POg=1QT|Z{;X(O9MHxX}Nd;C=`TU}EB|BfRT984Y_=nq{S(I$0 zub)|ztOrfIpk?Dqc4z`%ZJ=09EY1ddH8V}2GQU(IIWbQG?5E5;aNSb%%TZUYRRAf42qBtSHmEHw8-0)h lP})H*0zqOBQ&5_3AYnTO8%RsjM$yIJIV3W`RRO|h004maB}@PS literal 0 HcmV?d00001 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 @@ + +
+ diff --git a/templates/head.html b/templates/head.html new file mode 100644 index 0000000..d33f8e1 --- /dev/null +++ b/templates/head.html @@ -0,0 +1,3 @@ + + + diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..c3e038e --- /dev/null +++ b/templates/header.html @@ -0,0 +1,13 @@ + +
+
+          __                                          __                      __      
+---------/\ \__                                      /\ \                    /\ \__   
+---------\ \ ,_\  __  __  __  _   ___    ___   _ __  \_\ \        ___      __\ \ ,_\  
+----------\ \ \/ /\ \/\ \/\ \/'\ /'___\ / __`\/\`'__\/'_` \      /'_ `\  /'__`\ \ \/  
+-----------\ \ \_\ \ \_\ \/>  <//\ \__//\ \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' %} + + +
+ {% include 'header.html'%} +
+ + Services we provide: + + Join us: + +
+ + Members: + + +
+ +
+
+			{{ ascii_penguin|safe }}
+			
+
+ +
+ {% include 'footer.html' %} +
+ + diff --git a/templates/mc.html b/templates/mc.html new file mode 100644 index 0000000..dffe7b5 --- /dev/null +++ b/templates/mc.html @@ -0,0 +1,46 @@ + + + + + {% include 'head.html' %} + + +
+ {% include 'header.html'%} +
+ + Name: Tuxcord-MC
+ IP/Server Address: mc.tuxcord.net
+ Version: 1.12.8
+ The server has a whitelist, so join our Discord, Matrix or irc.tuxcord.net and ask
if you can join in the #.minecraft channel.
+ The server is cracked, so as to prevent bots and spam, we also have a registration system.
+ +
+ Rules:
+
    +
  1. + Joking around is Ok, but no directed hate speech. +
  2. +
  3. + Greifing and killing others is permitted. +
  4. +
  5. + No attempting to crash server or disrupt other people's gameplay with lag machines and the like. +
  6. +
  7. + While greifing is permitted in most cases, do not greif the main end island +
  8. +
+ + +
+
+			{{ ascii_penguin|safe }}
+			
+
+ + + +