From 6f2a398a67bb53d2ff7bec756f95ce524c57d7ab6408b589306ef253fe2a104a Mon Sep 17 00:00:00 2001 From: Nyx Date: Fri, 18 Apr 2025 09:49:46 -0500 Subject: [PATCH] php rewrite --- Dockerfile | 7 - app.sh | 10 -- .../88x31s/benjae.nekoweb.org.gif | Bin .../88x31s/freetards.xyz.gif | Bin .../assets => assets}/88x31s/fsky.io.webp | Bin .../88x31s/nyx.everypizza.im-2.png | Bin .../88x31s/nyx.everypizza.im.webp | Bin .../88x31s/purplebored.pl.gif | Bin .../88x31s/squarebowl.club.gif | Bin .../88x31s/synth.download.svg | 0 .../assets => assets}/88x31s/telepath.im.png | Bin .../88x31s/voxel.fsky.io.webp | Bin .../assets => assets}/88x31s/zayd.fsky.io.png | Bin .../assets => assets}/broken/isekai.rocks.svg | 0 {site/templates/assets => assets}/index.css | 0 .../templates/assets => assets}/index.css.old | 0 compose.yml | 9 -- site/templates/index.j2 => index.php | 104 +++++++++++++-- site/__pycache__/app.cpython-313.pyc | Bin 4852 -> 0 bytes site/app.py | 94 ------------- site/templates/index.j2.old | 126 ------------------ ...ount.sample.txt => visitorCount.sample.txt | 0 22 files changed, 90 insertions(+), 260 deletions(-) delete mode 100644 Dockerfile delete mode 100755 app.sh rename {site/templates/assets => assets}/88x31s/benjae.nekoweb.org.gif (100%) rename {site/templates/assets => assets}/88x31s/freetards.xyz.gif (100%) rename {site/templates/assets => assets}/88x31s/fsky.io.webp (100%) rename {site/templates/assets => assets}/88x31s/nyx.everypizza.im-2.png (100%) rename {site/templates/assets => assets}/88x31s/nyx.everypizza.im.webp (100%) rename {site/templates/assets => assets}/88x31s/purplebored.pl.gif (100%) rename {site/templates/assets => assets}/88x31s/squarebowl.club.gif (100%) rename {site/templates/assets => assets}/88x31s/synth.download.svg (100%) rename {site/templates/assets => assets}/88x31s/telepath.im.png (100%) rename {site/templates/assets => assets}/88x31s/voxel.fsky.io.webp (100%) rename {site/templates/assets => assets}/88x31s/zayd.fsky.io.png (100%) rename {site/templates/assets => assets}/broken/isekai.rocks.svg (100%) rename {site/templates/assets => assets}/index.css (100%) rename {site/templates/assets => assets}/index.css.old (100%) delete mode 100644 compose.yml rename site/templates/index.j2 => index.php (50%) delete mode 100644 site/__pycache__/app.cpython-313.pyc delete mode 100644 site/app.py delete mode 100644 site/templates/index.j2.old rename site/visitorCount.sample.txt => visitorCount.sample.txt (100%) diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 59dafdb..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM python:3-alpine - -WORKDIR /site -COPY . . -RUN pip install --no-cache-dir -r requirements.txt - -CMD ["waitress-serve", "--port=8000", "app.app"] diff --git a/app.sh b/app.sh deleted file mode 100755 index aefae55..0000000 --- a/app.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -main() { - cd site - waitress-serve --port=8041 'app.app' & -} - -main "$@" diff --git a/site/templates/assets/88x31s/benjae.nekoweb.org.gif b/assets/88x31s/benjae.nekoweb.org.gif similarity index 100% rename from site/templates/assets/88x31s/benjae.nekoweb.org.gif rename to assets/88x31s/benjae.nekoweb.org.gif diff --git a/site/templates/assets/88x31s/freetards.xyz.gif b/assets/88x31s/freetards.xyz.gif similarity index 100% rename from site/templates/assets/88x31s/freetards.xyz.gif rename to assets/88x31s/freetards.xyz.gif diff --git a/site/templates/assets/88x31s/fsky.io.webp b/assets/88x31s/fsky.io.webp similarity index 100% rename from site/templates/assets/88x31s/fsky.io.webp rename to assets/88x31s/fsky.io.webp diff --git a/site/templates/assets/88x31s/nyx.everypizza.im-2.png b/assets/88x31s/nyx.everypizza.im-2.png similarity index 100% rename from site/templates/assets/88x31s/nyx.everypizza.im-2.png rename to assets/88x31s/nyx.everypizza.im-2.png diff --git a/site/templates/assets/88x31s/nyx.everypizza.im.webp b/assets/88x31s/nyx.everypizza.im.webp similarity index 100% rename from site/templates/assets/88x31s/nyx.everypizza.im.webp rename to assets/88x31s/nyx.everypizza.im.webp diff --git a/site/templates/assets/88x31s/purplebored.pl.gif b/assets/88x31s/purplebored.pl.gif similarity index 100% rename from site/templates/assets/88x31s/purplebored.pl.gif rename to assets/88x31s/purplebored.pl.gif diff --git a/site/templates/assets/88x31s/squarebowl.club.gif b/assets/88x31s/squarebowl.club.gif similarity index 100% rename from site/templates/assets/88x31s/squarebowl.club.gif rename to assets/88x31s/squarebowl.club.gif diff --git a/site/templates/assets/88x31s/synth.download.svg b/assets/88x31s/synth.download.svg similarity index 100% rename from site/templates/assets/88x31s/synth.download.svg rename to assets/88x31s/synth.download.svg diff --git a/site/templates/assets/88x31s/telepath.im.png b/assets/88x31s/telepath.im.png similarity index 100% rename from site/templates/assets/88x31s/telepath.im.png rename to assets/88x31s/telepath.im.png diff --git a/site/templates/assets/88x31s/voxel.fsky.io.webp b/assets/88x31s/voxel.fsky.io.webp similarity index 100% rename from site/templates/assets/88x31s/voxel.fsky.io.webp rename to assets/88x31s/voxel.fsky.io.webp diff --git a/site/templates/assets/88x31s/zayd.fsky.io.png b/assets/88x31s/zayd.fsky.io.png similarity index 100% rename from site/templates/assets/88x31s/zayd.fsky.io.png rename to assets/88x31s/zayd.fsky.io.png diff --git a/site/templates/assets/broken/isekai.rocks.svg b/assets/broken/isekai.rocks.svg similarity index 100% rename from site/templates/assets/broken/isekai.rocks.svg rename to assets/broken/isekai.rocks.svg diff --git a/site/templates/assets/index.css b/assets/index.css similarity index 100% rename from site/templates/assets/index.css rename to assets/index.css diff --git a/site/templates/assets/index.css.old b/assets/index.css.old similarity index 100% rename from site/templates/assets/index.css.old rename to assets/index.css.old diff --git a/compose.yml b/compose.yml deleted file mode 100644 index 0c4b908..0000000 --- a/compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - utils: - build: - dockerfile: Dockerfile - ports: - - "8041:8000" # Will listen on port 65193, change that number to change the port - restart: unless-stopped - volumes: - - ./site:/site diff --git a/site/templates/index.j2 b/index.php similarity index 50% rename from site/templates/index.j2 rename to index.php index a9fa288..5fa6499 100644 --- a/site/templates/index.j2 +++ b/index.php @@ -1,4 +1,3 @@ - @@ -9,9 +8,30 @@ -

- welcome, visitor {{ visitor }}! -

+ $count!"; + ?>

Nyx Tutt

is a transfeminine robot-cat-girl-thing. @@ -86,9 +106,7 @@

projects

- this one has a ton of unfinished projects (and some that haven't - even had any work done yet)! its current idea is a GTK4 music player - along with a federated genius alternative. it also has a few things, + this one has a ton of unfinished projects. it also has a few things, like skibidifetch (a fork of badapplefetch by Ari), that are smaller. it also made a collection of web-based tools using server-side rendering, @@ -96,12 +114,45 @@

current project

- currently, it's making a web frontend for DICT (RFC2229) using Flask in the backend - and Tailwind CSS in the frontend. + learning Ruby and Rails

music

- {{ np }} + " . htmlspecialchars($user) . ": " . + htmlspecialchars($track) . " by " . + htmlspecialchars($artist) . " from " . + htmlspecialchars($album) . ""; + } + } catch (Exception $e) { + $nowPlayingString = "Failed to reach API"; + } + + echo $nowPlayingString; + ?> +
data is from listenbrainz. @@ -109,11 +160,36 @@

buttons

- {% for image, link in buttons %} - - {{ image }} + + Benjae - {% endfor %} + + Freetards + + + FSKY + + + Purplebored + + + PlateNet + + + synth.download + + + Telepath + + + voxel + + + voxel + +

+ Nyx + Nyx

diff --git a/site/__pycache__/app.cpython-313.pyc b/site/__pycache__/app.cpython-313.pyc deleted file mode 100644 index 326efbcfd7fe4200922e98ab245c7e7860e01d8e5311470eb5392000a59d0cc5..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4852 zcmcH+OKcm*b@s==qrOGtOeqb*2Yh_nrhY-TU5Pco!WEF*j&!BFy<%`XA)Gg1T_SdKbb=09}PzP(&Ep^nb&!7&~ zs9Wo(cRYi7M~!-C9re!ZUU667TL?)(gn%<%ZyBpEwu$Xx#~C()CfP|g+W9T{9OX@6 zC@X0*rXR~nTEx;*wTqc&yXu7P7V=1E;F%?gm9(i8IgQcM)F)9=d$v+isf`Hm!&i9w3!-lz}wx(tIg#l47>~3SSp(zr_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S1o)$c4@I|LLNHo;_T1uwzuLs0XL!1n13mo6{r zahUinXN3yManm)MfxIZ>WY_>WK$1waj@}J>fQK$y)C*Y|p8~#D;L%8!K>&E#OC5*H zo+HJ9b^q>VvFz_IUR-PIDPCOVcdU6s#WyyA4jHYs1#%?JQdwDxO@Gfu=&Tw+OW{lo zE&%m2KlW35OiS~Ug~q+G%Db$|PHXr@=r-zavkq&R97To*K~;ZuTdDoUvinr=heZF; zvOhxfk8bIYPXo0Pu=O9$kbA@Tt^2NRy4$njK3ELZ6~9E3sNd-wga|Yw-hG`Q>oh!G zcK1FS#lHTn}AA4itM>mHJ(8}LOeV)?sr26uJDY)Y@LDM3fQM6 zh-r4j*kxZ5wZ<8u3?{V-BG_fmV!CU$#Rd)CP%h_Xa+Smbz;X>9jciFp^dJx|zP9e| zS}v5my(PZaa+(m=)wG%didrMfrAuyu&eK!XTCSV0#-{YyEG&>HdKXclRyE}b7Lz#o zF+3XCK_QpC9m_A3y$4JDK}u@6lF3=P*CvyO^Jt9zGB@Eo465=|ss{Bxr(!+YW(pJJ zHjT-;=v0^_H?;~r06mjcHB3$?I7+}i0?7VAuKoI=%Ci4t2a5ESMVT_NW$Dw&UJQHP3N=nIeZ1a5r=Et0O2IgFpnIFd7UYv%U>h^ z*U0_AbExQC^Xx404|$K*Q*>53kb8t#bB$C4uGv%cY8WA&ZpZE^Ga$Rl8{UpRUS@hXSe7|KB%i2|Ud3gv>QtEtZLkb;h#*@lq*rku-nV3w dx%M^Q`QC*a7jCxSX)Rv(l0Q)45Z^&f_+J|mW0C*> diff --git a/site/app.py b/site/app.py deleted file mode 100644 index 6d4171c..0000000 --- a/site/app.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -from flask import Flask, render_template, make_response, send_from_directory -import requests -import os - -apiRoot = "https://api.listenbrainz.org" -user = "everypizza" - -buttons = [ - ("assets/88x31s/benjae.nekoweb.org.gif", "https://benjae.nekoweb.org"), - ("assets/88x31s/freetards.xyz.gif", "https://freetards.xyz"), - ("assets/88x31s/fsky.io.webp", "https://fsky.io"), - ("assets/88x31s/purplebored.pl.gif", "https://purplebored.pl"), - ("assets/88x31s/squarebowl.club.gif", "https://squarebowl.club"), - ("assets/88x31s/synth.download.svg", "https://synth.download"), - ("assets/88x31s/telepath.im.png", "https://telepath.im"), - ("assets/88x31s/voxel.fsky.io.webp", "https://voxel.fsky.io"), - ("assets/88x31s/zayd.fsky.io.png", "https://zayd.fsky.io"), - ] - -nyxbuttons = [ - ("assets/88x31s/nyx.everypizza.im.webp", "https://nyx.everypizza.im"), - ("assets/88x31s/nyx.everypizza.im-2.png", "https://nyx.everypizza.im"), - ] - -app = Flask(__name__) - -countFile = "visitorCount.txt" - -def get_visitor_count(): - try: - with open(countFile, "r") as f: - return int(f.read()) - except FileNotFoundError: - return 0 - -def increment_visitor_count(): - count = get_visitor_count() - count += 1 - with open(countFile, "w") as f: - f.write(str(count)) - return count - -@app.route('/') -def index(): - increment_visitor_count() - try: - data = requests.get(apiRoot + "/1/user/" + user + "/playing-now") - if not data.json()['payload']['listens']: - nowPlaying = False - nowPlayingString = "nothing is playing right now." - else: - track = data.json()['payload']['listens'][0]['track_metadata']['track_name'] - artist = data.json()['payload']['listens'][0]['track_metadata']['artist_name'] - album = data.json()['payload']['listens'][0]['track_metadata']['release_name'] - nowPlayingString = f"now playing for {user}: {track} by {artist} from {album}" - except: - nowPlayingString = "Failed to reach API" - - return render_template('index.j2', np=nowPlayingString, visitor=get_visitor_count(), buttons=buttons, nyxbuttons=nyxbuttons) - -@app.route('/assets/index.css') -def indexStyle(): - css = render_template('assets/index.css') - response = make_response(css) - response.mimetype = "text/css" - return response - -@app.route('/assets/particles.js') -def particleJs(): - js = render_template('assets/scripts/particles.js') - response = make_response(js) - response.mimetype = "text/javascript" - return response - -@app.route('/assets/birds.js') -def birdJs(): - js = render_template('assets/scripts/birds.js') - response = make_response(js) - response.mimetype = "text/javascript" - return response - -@app.route('/static/assets/88x31s/') -def serve_dir(filename): - directory = 'templates/assets/88x31s' - return send_from_directory(directory, filename) - -@app.route('/todo') -def todo(): - return render_template('todo.html') - -if __name__ == '__main__': - app.run(host="0.0.0.0", port=8080) diff --git a/site/templates/index.j2.old b/site/templates/index.j2.old deleted file mode 100644 index d8867ba..0000000 --- a/site/templates/index.j2.old +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Nyx's personal site - - - - - - -
-

- hello, visitor number {{ visitor }}! this one is glad to see you. -

-
- - this counter doesn't use javascript, it's just a text file with a digit in - it that gets increased by 1 on every page load. - -
-

- Nyx Tutt -

-

- about it -

-

- it is a cat-robot-girl-thing. it likes to speak about itself in the third person. - it likes linux and uses arch. it lives in texas, but hates it here. its favorite - color is pink. -

-

- interests -

-

- nyx has many interests. currently, it's been learning about networking, and the - C programming languages. it also likes open source software and protocols, like - XMPP. it also is a strong beliver in freedom of information, so it hosts things - like snowflake proxies. it also - likes retro design, and it sometimes will write a blog post on something random. - theming is also fun for it. -

-

- contact -

-

- this one has a few forms of contact:
-

- -

- please avoid using 2nd person pronouns when contacting it. -

-

- links -

- -

- pages -

- -

- now playing -

-

- {{ np }} -
- - data is from listenbrainz. - -

-

- 88x31s -

-

- {% for image, link in buttons %} - - {{ image }} - - {% endfor %} -

-

- this one's 88x31 -

-

- {% for image, link in nyxbuttons %} - - {{ image }} - - {% endfor %} -

- - diff --git a/site/visitorCount.sample.txt b/visitorCount.sample.txt similarity index 100% rename from site/visitorCount.sample.txt rename to visitorCount.sample.txt