From c4fbc62ec195c1fdea622a9b2c7593f8ad87fcef Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Tue, 26 Mar 2024 18:40:38 -0500 Subject: [PATCH 01/18] minor css and gitignore changes (again) --- .gitignore | 1 + app/static/style.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9fe92d2..46a471d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ docker-compose.yaml # Ignore images in posts *.jpg *.png +*.gif diff --git a/app/static/style.css b/app/static/style.css index 3ba8574..d657243 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -158,7 +158,7 @@ a:hover { text-decoration: underline; text-decoration-style: solid; text-decoration-thickness: 0.25em; - text-underline-offset: 6px; + text-underline-offset: 7px; text-decoration-color: var(--primary); } From 52800a249d0fb36d9a7bd97b6192ee6a724a29c3 Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Fri, 29 Mar 2024 11:30:53 -0500 Subject: [PATCH 02/18] added the writing page --- .gitignore | 4 ++++ Dockerfile | 6 +++--- app/static/writing.html | 9 +++++++++ app/templates/index.html | 11 ++++++----- 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 app/static/writing.html diff --git a/.gitignore b/.gitignore index 46a471d..8726ba8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ docker-compose.yaml *.jpg *.png *.gif + +# Writing +writing + diff --git a/Dockerfile b/Dockerfile index 67b613a..9360969 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,7 @@ FROM python:3.12.2-slim-bookworm RUN apt-get update && apt-get upgrade -y -RUN useradd -m app - -USER app +RUN groupadd -r app && useradd -r -g app app COPY . . @@ -15,4 +13,6 @@ RUN python3 -m pip install -r requirements.txt WORKDIR ./app +USER app + CMD ["python3", "-u", "app.py"] diff --git a/app/static/writing.html b/app/static/writing.html new file mode 100644 index 0000000..44de92c --- /dev/null +++ b/app/static/writing.html @@ -0,0 +1,9 @@ + + + + home +
+
+ Scream March 27th, 2024 + + \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index a5bfb0c..51412b8 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -14,11 +14,12 @@ From 3fefdcc7d8da82e38147e298b34bcec0c670f501 Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Fri, 29 Mar 2024 11:45:00 -0500 Subject: [PATCH 03/18] remove config from tracking --- .gitignore | 2 ++ app/config.ini | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 app/config.ini diff --git a/.gitignore b/.gitignore index 8726ba8..05a0f7a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ __pycache__ docker-compose.yaml *.sh +*.ini + # Ignore images in posts *.jpg *.png diff --git a/app/config.ini b/app/config.ini deleted file mode 100644 index 8d00b71..0000000 --- a/app/config.ini +++ /dev/null @@ -1,9 +0,0 @@ -[POSTS] -posts_folder=./posts - -[STATUS] -status_file=./resources/status.text - -[NETWORK] -PORT=1111 -DEV=0 From 75260fac0e30aa9d3dac14ad82da70c6472c94bc Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Wed, 3 Apr 2024 16:32:27 -0500 Subject: [PATCH 04/18] started album squared thing --- app/app.py | 56 +++++++++++++++++- .../2029240f6d1128be89ddc32729463129 | Bin 0 -> 9 bytes .../aa43147407c8a8c678cd91f678f2a023 | Bin 0 -> 90 bytes app/data/comments.json | 8 +++ app/data/users.json | 5 ++ app/static/albumsquare.css | 31 ++++++++++ app/static/style.css | 38 ++++++++++++ app/templates/album_square.html | 20 +++++++ app/templates/music.html | 12 ++++ 9 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 app/data/.flask_session/2029240f6d1128be89ddc32729463129 create mode 100644 app/data/.flask_session/aa43147407c8a8c678cd91f678f2a023 create mode 100644 app/data/comments.json create mode 100644 app/data/users.json create mode 100644 app/static/albumsquare.css create mode 100644 app/templates/album_square.html diff --git a/app/app.py b/app/app.py index 3492a78..d3f6ba5 100644 --- a/app/app.py +++ b/app/app.py @@ -2,6 +2,7 @@ import glob import configparser import random +import requests import flask import waitress import markdown @@ -19,6 +20,9 @@ STATUS_FILE = config['STATUS']['STATUS_FILE'] PORT = int(config['NETWORK']['PORT']) DEV = int(config['NETWORK']['DEV']) +MUSIC_API_TOKEN = config['AUTH']['MUSIC_API_TOKEN'] +MUSIC_API_URL = config['NETWORK']['MUSIC_API_URL'] + def get_posts(category_filter : str | None = None) -> list[Post]: post_files = glob.glob(f'{POSTS_FOLDER}/*') try: @@ -105,7 +109,25 @@ def music(): # Get status status = get_status() - return flask.render_template('music.html', posts=post_bodies, status=status) + # Get top albums + r = requests.get( + MUSIC_API_URL +'/top/albums', + headers={ + 'token' : MUSIC_API_TOKEN, + 'user' : '1', + 'limit' : '9' + }) + + top_albums = r.json()['top'] + for album_index in range(0, len(top_albums)): + album = top_albums[album_index] + + time = int(album['listen_time']) + hours = round(time/1000/60/60, 1) + + top_albums[album_index]['listen_time'] = hours + + return flask.render_template('music.html', posts=post_bodies, status=status, top_albums=top_albums) # Motion Pictures Page @app.route('/motion-pictures/') @@ -148,6 +170,38 @@ def about(): return flask.render_template('about.html', status=status) +# MISC + +@app.route('/albumsquare//') +def album_square(user_id, rows : int): + + limit = rows ** 2 + + res = 100/(rows+2) + + # Get top albums + r = requests.get( + MUSIC_API_URL +'/top/albums', + headers={ + 'token' : MUSIC_API_TOKEN, + 'user' : user_id, + 'limit' : str(limit) + }) + + top_albums = r.json()['top'] + for album_index in range(0, len(top_albums)): + album = top_albums[album_index] + + time = int(album['listen_time']) + hours = round(time/1000/60/60, 1) + + top_albums[album_index]['listen_time'] = hours + + + return flask.render_template('album_square.html', top_albums=top_albums, limit=rows, res=res) + + + if __name__ == "__main__": if DEV: app.run(port=PORT) diff --git a/app/data/.flask_session/2029240f6d1128be89ddc32729463129 b/app/data/.flask_session/2029240f6d1128be89ddc32729463129 new file mode 100644 index 0000000000000000000000000000000000000000..7f5741f13017ee705ea34021d222a06a6ee2a6c9 GIT binary patch literal 9 QcmZQzU|?uq^=8ro00XcA0RR91 literal 0 HcmV?d00001 diff --git a/app/data/.flask_session/aa43147407c8a8c678cd91f678f2a023 b/app/data/.flask_session/aa43147407c8a8c678cd91f678f2a023 new file mode 100644 index 0000000000000000000000000000000000000000..d818306312c02b6939f76f09975e7cd3b355c42e GIT binary patch literal 90 zcmeB))lF+)o$Ad10ku;!dbr{XQj2mE^HTFlrgZdhB^MW^#h2t~r{+!R(J-_yH#Sa5 oH8xK%HZ!wKO-(j2Ha1VQ1o9116D`cmEmPBs%u|z-r +
+ + + Album Square +
+ +
+ {% for album in top_albums %} + + + + {% if loop.index % limit == 0 %} +
+ {% endif %} + {% endfor %} +
+ + diff --git a/app/templates/music.html b/app/templates/music.html index 9a00a11..5e35363 100644 --- a/app/templates/music.html +++ b/app/templates/music.html @@ -28,6 +28,18 @@
{{ post|safe }}
{% endfor %} + +
+

Top Albums

+ {% for album in top_albums %} + + + + {% if loop.index % 3 == 0 %} +
+ {% endif %} + {% endfor %} +
From 6a065df685c291d1729fb8eb0ec3b6364527fbde Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Thu, 4 Apr 2024 14:25:04 -0500 Subject: [PATCH 05/18] kind of fixed the sizing for the album covers --- app/app.py | 2 +- app/static/albumsquare.css | 12 ------------ app/templates/album_square.html | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/app.py b/app/app.py index d3f6ba5..a28e1e1 100644 --- a/app/app.py +++ b/app/app.py @@ -177,7 +177,7 @@ def album_square(user_id, rows : int): limit = rows ** 2 - res = 100/(rows+2) + res = (1080/(rows))-rows # Get top albums r = requests.get( diff --git a/app/static/albumsquare.css b/app/static/albumsquare.css index 0f1cb6c..1044b3d 100644 --- a/app/static/albumsquare.css +++ b/app/static/albumsquare.css @@ -1,23 +1,11 @@ .albums { height: 100%; - height: fit-content; - align-self: flex-start; - border-style: var(--borders-style); - border-radius: var(--border-radius); - border-color: #1E2022; - background-color: var(--main-background); - - /* Text Settings - font-weight: bold; - line-height: 30pt; */ line-height: 0; font-size: 0; } .albums img { - height: 100px; - width: 100px; padding: 0 0; margin: 0 0; border: 0 0; diff --git a/app/templates/album_square.html b/app/templates/album_square.html index dfd49b7..ca6d024 100644 --- a/app/templates/album_square.html +++ b/app/templates/album_square.html @@ -9,7 +9,7 @@
{% for album in top_albums %} - + {% if loop.index % limit == 0 %}
From 9ebf599a07a07ca7a8f61258bcaff7f712d1205e Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Thu, 4 Apr 2024 15:48:29 -0500 Subject: [PATCH 06/18] css changes --- app/static/style.css | 22 +++++++++++++++------- app/templates/music.html | 18 ++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/app/static/style.css b/app/static/style.css index ace95c1..610c56e 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -192,11 +192,10 @@ a:hover { /* Text Settings font-weight: bold; line-height: 30pt; */ - line-height: 0; - font-size: 0; } -.albums img { + +.real-albums img { height: 100px; width: 100px; padding: 0 0; @@ -204,9 +203,18 @@ a:hover { border: 0 0; } -.albums h1 { - font-size: normal; - text-align: center; - padding: 0.5em 0; +.real-albums { + line-height: 0; + font-size: 0; + padding: 0 0; + margin: 0 0; +} + +.albums h1 { + font-size: 2em; + text-align: center; + padding: 0 0; + margin: 15pt 0; + margin-top: -5pt; } diff --git a/app/templates/music.html b/app/templates/music.html index 5e35363..f2c0fcf 100644 --- a/app/templates/music.html +++ b/app/templates/music.html @@ -31,14 +31,16 @@

Top Albums

- {% for album in top_albums %} - - - - {% if loop.index % 3 == 0 %} -
- {% endif %} - {% endfor %} +
+ {% for album in top_albums %} + + + + {% if loop.index % 3 == 0 %} +
+ {% endif %} + {% endfor %} +
From 012a663aa0df102dba383c3fd38d4051917f0e75 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Fri, 12 Apr 2024 13:53:56 -0500 Subject: [PATCH 07/18] new status --- app/resources/status.text | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/resources/status.text b/app/resources/status.text index c258209..7f78371 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -28,4 +28,5 @@ I'd cross a thousand seas just to prove I'm not mad I thought I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there Solar Sect of Mystic Wisdom ~ Nuclear Fusion -Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! \ No newline at end of file +Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! +So, silent tide / Tell me which face do I show the world / And which one do I hide? \ No newline at end of file From 4dba456dcd5fd638ab14ce29009d26789cce3b19 Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Tue, 23 Apr 2024 10:09:59 -0500 Subject: [PATCH 08/18] adding programming page stuff --- app/static/programming/vscode_extensions.txt | 12 +++++++ app/static/style.css | 33 ++++++++++++++++++++ app/templates/programming.html | 6 ++++ 3 files changed, 51 insertions(+) create mode 100644 app/static/programming/vscode_extensions.txt diff --git a/app/static/programming/vscode_extensions.txt b/app/static/programming/vscode_extensions.txt new file mode 100644 index 0000000..a0edf1d --- /dev/null +++ b/app/static/programming/vscode_extensions.txt @@ -0,0 +1,12 @@ +EOF Mark, +Glassit-VSC, +JSON formatter, +Pylance, +Remote - SSH, +Synthwave '84 Blues, +Trailing Spaces, +Helm Intellisense, +background, +Helium Icon Theme, +SQLite Viewer, +Docker \ No newline at end of file diff --git a/app/static/style.css b/app/static/style.css index 610c56e..67ad496 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -107,6 +107,39 @@ a:hover { text-decoration: none; } +.rightbar { + height: fit-content; + align-self: flex-start; + top: 10px; + + padding: 20pt; + + margin: 5em 0; + margin-right: 2em; + + border-style: var(--borders-style); + border-radius: var(--border-radius); + border-color: #1E2022; + background-color: var(--main-background); + + opacity: 0.9; + + /* box-shadow: -10px 10px var(--accent); */ + + /* Text Settings */ + font-weight: bold; + line-height: 30pt; +} + +.rightbar a { + text-decoration: none; +} + +.rightbar h2 { + font-family: Georgia, 'Times New Roman', Times, serif; + line-height: normal; +} + .dlog { flex: 3; diff --git a/app/templates/programming.html b/app/templates/programming.html index 91a5a31..2d42ceb 100644 --- a/app/templates/programming.html +++ b/app/templates/programming.html @@ -28,6 +28,12 @@
{{ post|safe }}
{% endfor %} + + +
+

Other

+ Technologies I Use +
From a66265e81388cc262cde44feb0fb0423cdbd44cb Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Tue, 23 Apr 2024 10:20:31 -0500 Subject: [PATCH 09/18] forgot to add requests to requirements --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bb91e2f..85ba8d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Markdown==3.5.2 Flask==2.2.3 waitress==2.1.2 -Werkzeug==2.2.3 \ No newline at end of file +Werkzeug==2.2.3 +requests==2.31.0 \ No newline at end of file From 6c2f7427f742243cbee8f3fce3d6c5fdb9339d0d Mon Sep 17 00:00:00 2001 From: 0x01FE <0x10FE@0x01fe.net> Date: Tue, 23 Apr 2024 11:11:54 -0500 Subject: [PATCH 10/18] made a template for the writing page --- app/app.py | 28 ++++++++++++++++++++++++++++ app/static/writing.html | 9 --------- app/templates/about.html | 1 + app/templates/games.html | 1 + app/templates/index.html | 2 +- app/templates/motion-pictures.html | 1 + app/templates/music.html | 1 + app/templates/programming.html | 1 + app/templates/writing.html | 11 +++++++++++ 9 files changed, 45 insertions(+), 10 deletions(-) delete mode 100644 app/static/writing.html create mode 100644 app/templates/writing.html diff --git a/app/app.py b/app/app.py index a28e1e1..a7e1217 100644 --- a/app/app.py +++ b/app/app.py @@ -1,6 +1,8 @@ +import os import glob import configparser import random +import datetime import requests import flask @@ -15,6 +17,7 @@ CONFIG_PATH = "./config.ini" config = configparser.ConfigParser() config.read(CONFIG_PATH) +WRITING_FOLDER = 'static/writing/' POSTS_FOLDER = config['POSTS']['POSTS_FOLDER'] STATUS_FILE = config['STATUS']['STATUS_FILE'] PORT = int(config['NETWORK']['PORT']) @@ -161,6 +164,31 @@ def programming(): return flask.render_template('programming.html', posts=post_bodies, status=status) +@app.route('/writing/') +def writing(): + + works = [] + + # Get all works in writing folder + files = glob.glob(WRITING_FOLDER + '*') + + for path in files: + + date: str = datetime.datetime.fromtimestamp(os.path.getctime(path)).strftime("%B %d, %Y") + name: str = path.split('/')[-1] + + works.append({ + 'date' : date, + 'name' : name, + 'path' : path + }) + + return flask.render_template('writing.html', works=works) + + + + + # About Page @app.route('/about/') def about(): diff --git a/app/static/writing.html b/app/static/writing.html deleted file mode 100644 index 44de92c..0000000 --- a/app/static/writing.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - home -
-
- Scream March 27th, 2024 - - \ No newline at end of file diff --git a/app/templates/about.html b/app/templates/about.html index a2663fc..ce7774c 100644 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -18,6 +18,7 @@ Music
Motion Picture
Programming
+ Writing
About diff --git a/app/templates/games.html b/app/templates/games.html index d023f8b..0ffded7 100644 --- a/app/templates/games.html +++ b/app/templates/games.html @@ -18,6 +18,7 @@ Music
Motion Picture
Programming
+ Writing
About diff --git a/app/templates/index.html b/app/templates/index.html index 51412b8..def98bd 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -18,7 +18,7 @@ Music
Motion Picture
Programming
- Writing
+ Writing
About diff --git a/app/templates/motion-pictures.html b/app/templates/motion-pictures.html index 459f655..87d36f9 100644 --- a/app/templates/motion-pictures.html +++ b/app/templates/motion-pictures.html @@ -18,6 +18,7 @@ Music
Motion Picture
Programming
+ Writing
About diff --git a/app/templates/music.html b/app/templates/music.html index f2c0fcf..5ea89f3 100644 --- a/app/templates/music.html +++ b/app/templates/music.html @@ -18,6 +18,7 @@ Music
Motion Picture
Programming
+ Writing
About diff --git a/app/templates/programming.html b/app/templates/programming.html index 2d42ceb..d146ccd 100644 --- a/app/templates/programming.html +++ b/app/templates/programming.html @@ -18,6 +18,7 @@ Music
Motion Picture
Programming
+ Writing
About diff --git a/app/templates/writing.html b/app/templates/writing.html new file mode 100644 index 0000000..09df245 --- /dev/null +++ b/app/templates/writing.html @@ -0,0 +1,11 @@ + + + + home +
+
+ {% for work in works %} + {{ work.name }} {{ work.date }} + {% endfor %} + + \ No newline at end of file From 492c2f923ef584d8437f08e93e5a062d5e523c2c Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Tue, 23 Apr 2024 12:40:51 -0500 Subject: [PATCH 11/18] readme edits --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index d8282e3..c9fa882 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,5 @@ Code of the website hosted at https://www.0x01fe.net -Could I gitignore the config files? -Yes. -Do I? -no. +One might ask why my pretty simple website is written in Python. The answer is so that I can just drop markdown files in a folder and have them automatically formatted and uploaded. This is done using the fact that markdown translates to HTML perfectly and that Flask / Jinja2 templates are really easy to use! From f90136e0226b8461a4e0011a9be96eabe69c1d84 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Thu, 6 Jun 2024 12:20:41 -0500 Subject: [PATCH 12/18] new status just dropped --- app/resources/status.text | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/resources/status.text b/app/resources/status.text index c258209..712da3d 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -28,4 +28,5 @@ I'd cross a thousand seas just to prove I'm not mad I thought I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there Solar Sect of Mystic Wisdom ~ Nuclear Fusion -Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! \ No newline at end of file +Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! +I'm a fool, I know nothing / I take the role of a silly clown \ No newline at end of file From 3672b754b786a0cd00149c107bf483cf7f994c71 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Mon, 10 Jun 2024 13:40:55 -0500 Subject: [PATCH 13/18] more guilty gear strive lyrics --- app/resources/status.text | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/resources/status.text b/app/resources/status.text index 712da3d..b9bf4f1 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -29,4 +29,7 @@ I thought I saw a statue blink, and a bird with no head, Land on a golden thread Solar Sect of Mystic Wisdom ~ Nuclear Fusion Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! -I'm a fool, I know nothing / I take the role of a silly clown \ No newline at end of file +I'm a fool, I know nothing / I take the role of a silly clown +All I do is embrace the wounded soul +So carry on, love the subhuman self +Break yourself inside out \ No newline at end of file From aa4eb8951197dbb5e2d7bfa52633eaf0536470bb Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Tue, 11 Jun 2024 08:16:03 -0500 Subject: [PATCH 14/18] another ggs lyric --- app/resources/status.text | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/resources/status.text b/app/resources/status.text index b9bf4f1..ccc3bb0 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -32,4 +32,5 @@ Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer- I'm a fool, I know nothing / I take the role of a silly clown All I do is embrace the wounded soul So carry on, love the subhuman self -Break yourself inside out \ No newline at end of file +Break yourself inside out +We're just a quirky note in the symphony \ No newline at end of file From b8dc89723e8603063921c8622fcbffa121b0a16e Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Wed, 12 Jun 2024 14:58:08 -0500 Subject: [PATCH 15/18] fixed a lyric --- app/resources/status.text | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/resources/status.text b/app/resources/status.text index 2ad2505..d8888a1 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -29,12 +29,9 @@ I thought I saw a statue blink, and a bird with no head, Land on a golden thread Solar Sect of Mystic Wisdom ~ Nuclear Fusion Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! -<<<<<<< HEAD I'm a fool, I know nothing / I take the role of a silly clown All I do is embrace the wounded soul So carry on, love the subhuman self -Break yourself inside out +Break yourself inside out, she told me We're just a quirky note in the symphony -======= So, silent tide / Tell me which face do I show the world / And which one do I hide? ->>>>>>> main From de12b4175a23bae471cb6de89107d88844b4596b Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Mon, 17 Jun 2024 15:02:54 -0500 Subject: [PATCH 16/18] a little redo of how the statuses are stored --- app/app.py | 17 +++++++-- app/resources/status.text | 74 +++++++++++++++++++++++++++++---------- 2 files changed, 71 insertions(+), 20 deletions(-) diff --git a/app/app.py b/app/app.py index a7e1217..a735495 100644 --- a/app/app.py +++ b/app/app.py @@ -25,6 +25,7 @@ DEV = int(config['NETWORK']['DEV']) MUSIC_API_TOKEN = config['AUTH']['MUSIC_API_TOKEN'] MUSIC_API_URL = config['NETWORK']['MUSIC_API_URL'] +statuses = None def get_posts(category_filter : str | None = None) -> list[Post]: post_files = glob.glob(f'{POSTS_FOLDER}/*') @@ -58,10 +59,18 @@ def get_posts(category_filter : str | None = None) -> list[Post]: return reversed(ordered_posts) -def get_status() -> str: +def read_status_file() -> list[str]: with open(STATUS_FILE, 'r', encoding='utf-8') as file: - statuses = file.readlines() + data = file.readlines() + result = [] + for line in data: + if not (line == '\n' or line[0] == '#'): + result.append(line) + + return result + +def get_status() -> str: status = random.randint(0, len(statuses) - 1) return markdown.markdown(statuses[status]) @@ -231,6 +240,10 @@ def album_square(user_id, rows : int): if __name__ == "__main__": + + statuses = read_status_file() + print(statuses) + if DEV: app.run(port=PORT) else: diff --git a/app/resources/status.text b/app/resources/status.text index d8888a1..f915d06 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -1,37 +1,75 @@ -Catchy Right? -Everybody's lazy when they're tired -As long as there is delusion, there is hope -It's 510. -Mindful of the weary inkling that is lurking -Mortal traffic lights signaling when to stay or go -Cyber surgeon, Javascript person -Bone-dried swamplands swallow me -House of dust, land of bone -I ate dirt, I drank stone -Come on, snake, punish me -Drip, drip from the tap, don't slip on the drip -His name really is Tim. -Just wait until you see the 1 in 1000 message. -I'm open to suggestions on how to improve the look of the website +# Project Moon Open the curtains Don't miss a moment of this experiment Needles Sally forth Rocinante! The multitude tightens its hold. + +# Misc +Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! +Solar Sect of Mystic Wisdom +~ Nuclear Fusion +His name really is Tim. +Just wait until you see the 1 in 1000 message. +I'm open to suggestions on how to improve the look of the website +As long as there is delusion, there is hope +It's 510. +Catchy Right? + + + +## Song Lyrics + +# I’m in Your Mind by King Gizzard & The Lizard Wizard +Everybody's lazy when they're tired + +# Straws In The Wind by King Gizzard & The Lizard Wizard +Mindful of the weary inkling that is lurking +Mortal traffic lights signaling when to stay or go + +# Automation by King Gizzard & The Lizard Wizard +Cyber surgeon, Javascript person + +# Gilgamesh by King Gizzard & The Lizard Wizard +Bone-dried swamplands swallow me +House of dust, land of bone +I ate dirt, I drank stone +Come on, snake, punish me + +# The Dripping Tap by King Gizzard & The Lizard Wizard +Drip, drip from the tap, don't slip on the drip + +# Face to Face by Daft Punk It's amazing what you'll find face to face It's not hard to go the distance / When you finally get involved face to face + +# Touch by Daft Punk A tourist in a dream / A visitor, it seems / A half-forgotten song / Where do I belong? + +# Magenta Mountian by King Gizzard & The Lizard Wizard What do you mean ... You can't see it? I don't believe you / your eyes deceive you / better check yourself in You will say I'm crazy / I will go on my way 'cause it's what I need I'd cross a thousand seas just to prove I'm not mad I thought I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there -Solar Sect of Mystic Wisdom -~ Nuclear Fusion -Check out [NEUPINK](https://neupink.bandcamp.com/album/swordflower-hills-killer-2)! + +# Armor-clad Faith by NAOKI, Arc System Works I'm a fool, I know nothing / I take the role of a silly clown All I do is embrace the wounded soul + +# Love the Subhuman Self by AISHA, Jamison Boaz, Arc System Works (Guilty Gear Strive) So carry on, love the subhuman self Break yourself inside out, she told me + +# Symphony by NAOKI, Arc System Works (Guilty Gear Strive) We're just a quirky note in the symphony + +# White Whale by Shadow Academy So, silent tide / Tell me which face do I show the world / And which one do I hide? + +# Intrasport by King Gizzard & The Lizard Wizard +Dreams that sew me up like sleeping with a needle +Those feelings that I had are building up to something +I feel a schism in the rhythm, now I'm running +My hair is liquifying +My taste buds are igniting From 471b22388178027e97f55014eb389128a86da042 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Thu, 20 Jun 2024 14:07:30 -0500 Subject: [PATCH 17/18] added a tooltip thing for status source and added more lyrics --- app/app.py | 32 +++++++++++++++++++++++++------- app/resources/status.text | 21 +++++++++++++++++++-- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/app/app.py b/app/app.py index a735495..bcc16d9 100644 --- a/app/app.py +++ b/app/app.py @@ -25,7 +25,7 @@ DEV = int(config['NETWORK']['DEV']) MUSIC_API_TOKEN = config['AUTH']['MUSIC_API_TOKEN'] MUSIC_API_URL = config['NETWORK']['MUSIC_API_URL'] -statuses = None +statuses = {} def get_posts(category_filter : str | None = None) -> list[Post]: post_files = glob.glob(f'{POSTS_FOLDER}/*') @@ -59,21 +59,39 @@ def get_posts(category_filter : str | None = None) -> list[Post]: return reversed(ordered_posts) -def read_status_file() -> list[str]: +def read_status_file() -> dict: with open(STATUS_FILE, 'r', encoding='utf-8') as file: data = file.readlines() - result = [] + result = {} + current_key = None for line in data: - if not (line == '\n' or line[0] == '#'): - result.append(line) + if line[0] == '#': + + # Empty Key-Value pairs will cause errors + if current_key: + if not result[current_key]: + result.pop(current_key) + + current_key = line.replace('#', '').strip() + result[current_key] = [] + elif not (line == '\n'): + result[current_key].append(line) return result def get_status() -> str: - status = random.randint(0, len(statuses) - 1) + keys = list(statuses.keys()) - return markdown.markdown(statuses[status]) + selected_key = keys[random.randint(0, len(keys) - 1)] + section: list = statuses[selected_key] + + print(selected_key) + print(section) + + selected_status = section[random.randint(0, len(section) - 1)] + + return f'
{markdown.markdown(selected_status)}
' # Main Page @app.route('/') diff --git a/app/resources/status.text b/app/resources/status.text index f915d06..bff44eb 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -1,6 +1,4 @@ # Project Moon -Open the curtains -Don't miss a moment of this experiment Needles Sally forth Rocinante! The multitude tightens its hold. @@ -73,3 +71,22 @@ Those feelings that I had are building up to something I feel a schism in the rhythm, now I'm running My hair is liquifying My taste buds are igniting + +# Set by King Gizzard & The Lizard Wizard +Cut the cord, kill the king and reset +Squeezing day into night with supernatural pressure +Right eye is the sun and left the moon's light + +# Swan Song by King Gizzard & The Lizard Wizard +Score the music // Of your essence +Stars fall from their lofty places +Earth has been put through her paces +Cosmic surgeons cut the cable +Make a new world if you're able + +# String Theocracy by Mili +Open the curtains +Don't miss a moment of this experiment +If you're going to replace me // At least have the audacity to kill me thoroughly +What's the color of the electric sheep you see? +Maybe we're all cold machines From 11d54f44808e905d85b33cfb5e17f61b5bd8b466 Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Mon, 24 Jun 2024 16:05:04 -0500 Subject: [PATCH 18/18] more statuses & made posts linkable --- app/app.py | 14 ++++++++++---- app/post.py | 6 +++++- app/resources/status.text | 20 ++++++++++++++++++++ app/templates/writing.html | 3 +++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/app/app.py b/app/app.py index bcc16d9..4036eb5 100644 --- a/app/app.py +++ b/app/app.py @@ -86,9 +86,6 @@ def get_status() -> str: selected_key = keys[random.randint(0, len(keys) - 1)] section: list = statuses[selected_key] - print(selected_key) - print(section) - selected_status = section[random.randint(0, len(section) - 1)] return f'
{markdown.markdown(selected_status)}
' @@ -109,6 +106,16 @@ def index(): return flask.render_template('index.html', posts=post_bodies, status=status) +# Posts +@app.route('/post/') +def post(post_name: str): + + for post in get_posts(): + if post.title.replace(' ', '-') == post_name: + return flask.render_template('index.html', posts=[post.body], status=get_status()) + + flask.abort(404) + # Games Page @app.route('/games/') def games(): @@ -260,7 +267,6 @@ def album_square(user_id, rows : int): if __name__ == "__main__": statuses = read_status_file() - print(statuses) if DEV: app.run(port=PORT) diff --git a/app/post.py b/app/post.py index 1de822a..954fbf2 100644 --- a/app/post.py +++ b/app/post.py @@ -8,6 +8,8 @@ class Post: date : datetime.datetime body : str file : str + title : str + url : str def __init__(self, file_path): self.file = file_path @@ -17,9 +19,11 @@ class Post: self.category = lines[1].split(":")[1].strip() self.author = lines[2].split(":")[1].strip() + self.title = lines[6][2:-1] + self.url = '/post/' + self.title.replace(' ', '-') date = lines[3].split(":")[1].strip() self.date = datetime.datetime.strptime(date, "%d-%m-%Y") - self.body = markdown.markdown(''.join(lines[6:])) + self.body = markdown.markdown(f'# [{self.title}]({self.url})\n' + ''.join(lines[7:])) diff --git a/app/resources/status.text b/app/resources/status.text index bff44eb..0fece64 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -14,7 +14,10 @@ As long as there is delusion, there is hope It's 510. Catchy Right? +## TV / Movie Quotes +# Monogatari +I don't know everything, I only know what I know. ## Song Lyrics @@ -90,3 +93,20 @@ Don't miss a moment of this experiment If you're going to replace me // At least have the audacity to kill me thoroughly What's the color of the electric sheep you see? Maybe we're all cold machines + +# Change by King Gizzard & The Lizard Wizard +We're changing pace // Higher stakes +So called heroes wearing fake capes +Buildings that you know // People come and go // Are a certain way +And then you get the news that obliterates your view // Amputate your truths // The signifiance has changed +Hospital inane // Meaningless and grey // But lie within the walls and the signifiance will change +What would it take for us to change the game? // Maybe our existence is signifiance in vain + +# Candles by King Gizzard & The Lizard Wizard +This little man is too hot to handle // Set the funeral on fire with the candles +Praying to the gods at the top of a mountian // Better throwing all your pennies in a fountian +My little heart, as cold as a morgue // Let the weight of it drop like an iceberg + +# Presumptuous by King Gizzard & The Lizard Wizard +Eggshell, landmine, stepping stones // Kindred spirits at a crossroads +The world we built is on a tilt // Bottled up inside and filled with guilt diff --git a/app/templates/writing.html b/app/templates/writing.html index 09df245..fdbc293 100644 --- a/app/templates/writing.html +++ b/app/templates/writing.html @@ -2,6 +2,9 @@ home +

+ This is just a little page where I post stuff I write. I was kind of unsure if I wanted this stuff out here but I think to those who know me it could serve as an interesting view into some thoughts that I don't often express elsewhere. +



{% for work in works %}