From b8dc89723e8603063921c8622fcbffa121b0a16e Mon Sep 17 00:00:00 2001 From: 0x01fe Date: Wed, 12 Jun 2024 14:58:08 -0500 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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 %}