added a tooltip thing for status source and added more lyrics
This commit is contained in:
parent
de12b4175a
commit
471b223881
32
app/app.py
32
app/app.py
@ -25,7 +25,7 @@ DEV = int(config['NETWORK']['DEV'])
|
|||||||
|
|
||||||
MUSIC_API_TOKEN = config['AUTH']['MUSIC_API_TOKEN']
|
MUSIC_API_TOKEN = config['AUTH']['MUSIC_API_TOKEN']
|
||||||
MUSIC_API_URL = config['NETWORK']['MUSIC_API_URL']
|
MUSIC_API_URL = config['NETWORK']['MUSIC_API_URL']
|
||||||
statuses = None
|
statuses = {}
|
||||||
|
|
||||||
def get_posts(category_filter : str | None = None) -> list[Post]:
|
def get_posts(category_filter : str | None = None) -> list[Post]:
|
||||||
post_files = glob.glob(f'{POSTS_FOLDER}/*')
|
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)
|
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:
|
with open(STATUS_FILE, 'r', encoding='utf-8') as file:
|
||||||
data = file.readlines()
|
data = file.readlines()
|
||||||
|
|
||||||
result = []
|
result = {}
|
||||||
|
current_key = None
|
||||||
for line in data:
|
for line in data:
|
||||||
if not (line == '\n' or line[0] == '#'):
|
if line[0] == '#':
|
||||||
result.append(line)
|
|
||||||
|
# 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
|
return result
|
||||||
|
|
||||||
def get_status() -> str:
|
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'<div title="{selected_key}">{markdown.markdown(selected_status)}</div>'
|
||||||
|
|
||||||
# Main Page
|
# Main Page
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
# Project Moon
|
# Project Moon
|
||||||
Open the curtains
|
|
||||||
Don't miss a moment of this experiment
|
|
||||||
Needles
|
Needles
|
||||||
Sally forth Rocinante!
|
Sally forth Rocinante!
|
||||||
The multitude tightens its hold.
|
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
|
I feel a schism in the rhythm, now I'm running
|
||||||
My hair is liquifying
|
My hair is liquifying
|
||||||
My taste buds are igniting
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user