diff --git a/generate_card.py b/generate_card.py index ff86e12..d8bacff 100644 --- a/generate_card.py +++ b/generate_card.py @@ -20,7 +20,7 @@ def generate_card(name, text): # Apply font font = ImageFont.truetype("./src/fonts/archivo.ttf", 25) - wrap = textwrap.wrap(text, 33, break_long_words=True) + wrap = textwrap.wrap(text, 25, break_long_words=True) text = "\n".join(wrap) @@ -38,10 +38,10 @@ def generate_card(name, text): # Put text on a random spot of the screen - x = randint(10, img.width - padding - width) - #if x < 0: x = 0 - y = randint(10, img.height - padding - height) - #if y < 0: y = 0 + try: x = randint(10, img.width - padding - width) + except: x = 0 + try: y = randint(10, img.height - padding - height) + except: y = 0 draw.text( (x, y), text, @@ -76,4 +76,4 @@ def generate_card(name, text): # Convert into JPEG image and save jpg = Image.new("RGB", img.size, (255, 255, 255)) jpg.paste(img, mask=img.split()[3]) - jpg.save(name, "JPEG") \ No newline at end of file + jpg.save(name, "JPEG", quality="80", optimize=True) diff --git a/src/templates/_footer.html b/src/templates/_footer.html index f71e8f9..645f9b0 100644 --- a/src/templates/_footer.html +++ b/src/templates/_footer.html @@ -3,10 +3,10 @@

©2023 Weird Radio Messages
- / wrm.neocities.org / + - wrm.neocities.org -

I stole the background from AN Lucas and my profile picture and icon from Clker-Free-Vector-Images (Pixabay).

- \ No newline at end of file + diff --git a/src/templates/about_me.html b/src/templates/about_me.html index 8beb45e..61b5a8c 100644 --- a/src/templates/about_me.html +++ b/src/templates/about_me.html @@ -2,6 +2,6 @@

About me

-

As I don't know who made is sending this messages, I have decided to stay as anonymous as I can for know, but you can refer to me as "WRM-Admin". I was born and currently live happilly on [place]. I have a crush for computers, radio and all types of geeky stuff. I'm a huge fan of retro-aesthetics.

+

As I don't know who made is sending this messages, I have decided to stay as anonymous as I can for know, but you can refer to me as "WRM-Admin". All the messages were received near Seattle, WA. I have a crush for computers, radio and all types of geeky stuff. I'm a huge fan of retro-aesthetics.

-$footer; \ No newline at end of file +$footer; diff --git a/src/templates/index.html b/src/templates/index.html index 9167365..c8fa957 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -8,7 +8,7 @@

Introduction

I think it was interesting so I setup my phone all the night waiting for that misterious radio to transmit again, to see if this was a one-off thing or if this was something else. And sure as it was, I've recibied another similar image, but with another text: 'No Real. Request failed successfully. Modify and try again later'.

I don't know what this could be. Maybe it could be a radioafficionate using this signal as its personal feed to send very bizarre shitpost all day, maybe it could be some kind of spy station made by some strange goverment agencies, or even aliens? Maybe? But I honestly have no idea.

I've created this website in order to document this strange occurrance, gather as much information as I can and try to solve this rather enigmatic mystery.

-

I'll leave a dedicated device to recive and convert this signals to images and I'll setup a Python script that will recolect all of the images that I have and then update the 'Transmissions' section of this website with a transcription and then just post that transcription to a dedicated Mastodon account.

+

I'll leave a dedicated device to recive and convert this signals to images and I'll setup a Python script that will recolect all of the images that I have and then update the 'Transmissions' section of this website with a transcription and then just post that transcription to a dedicated Mastodon account.

-

If you have any clue of what this could be, please try tagging the account.

-$footer; \ No newline at end of file +

==> If you have any clue of what this could be, please try tagging the account. <==

+$footer; diff --git a/src/templates/not_found.html b/src/templates/not_found.html index 8cd6824..d0de510 100644 --- a/src/templates/not_found.html +++ b/src/templates/not_found.html @@ -1,4 +1,4 @@ $header; -

404

-

Page not found.

-$footer; \ No newline at end of file +

HTTP code: 404

+

The page you have requested unfortunately, was not found.

+$footer; diff --git a/src/templates/style.css b/src/templates/style.css index ccfb660..a687c08 100644 --- a/src/templates/style.css +++ b/src/templates/style.css @@ -22,13 +22,16 @@ body { } #gallery li { float: left; - width: 33%; + width: 32.60%; + height: 200px; + overflow-y: auto; + overflow-wrap: break-word; text-align: center; border: solid 1px white; } #gallery img { - min-width: 90px; - max-width: 150px; + width: 150px; + height: auto; } @media only screen and (max-width: 1000px) { @@ -39,4 +42,4 @@ body { @media only screen and (max-width: 500px) { html { padding: 3px 3px; } #gallery li { width: 97.50%; } -} \ No newline at end of file +} diff --git a/src/templates/transmissions.html b/src/templates/transmissions.html index eae5304..670ebec 100644 --- a/src/templates/transmissions.html +++ b/src/templates/transmissions.html @@ -22,6 +22,6 @@

Transmissions

-$footer; \ No newline at end of file +$footer; diff --git a/src/templates/transmissions.js b/src/templates/transmissions.js index 4d8574c..c58f42d 100644 --- a/src/templates/transmissions.js +++ b/src/templates/transmissions.js @@ -13,6 +13,7 @@ async function getNewData () { // Store data into the 'data' function when gotten getNewData().then(contents => { data = contents; + data.reverse(); document.getElementById("more").style = "display: block;"; renderMore(); }); @@ -41,15 +42,17 @@ function renderMore () { var info = data[already]; var note = info["note"]; if (note !== "") { note = "
Note: " + note + ""; } - var date = new Date(info["date"].toString()); + // Parse date + var date = new Date(info["date"].toString()).toUTCString(); + // Add to the gallery document.getElementById("gallery").innerHTML += `
  • - ${scapeTags(info[ + ${scapeTags(info[
    Caption: ${scapeTags(info["caption"])}
    - Date: ${date.getUTCFullYear()}/${date.getUTCMonth()}/${date.getUTCDay()} ${date.getUTCHours()}:${date.getUTCMinutes()}hs UTC + Date: ${date} ${note}
  • @@ -61,4 +64,4 @@ function renderMore () { already++; // Count! } document.getElementById("loading").innerHTML = ""; -} \ No newline at end of file +} diff --git a/src/twrt.nim b/src/twrt.nim index 590df0b..8a5451c 100644 --- a/src/twrt.nim +++ b/src/twrt.nim @@ -1,15 +1,17 @@ const doc = """ The Weird Radio Transmitter -| This software is open-source! +| This software is open source! | https://github.com/exitcas/twrt.git -Usage: twrt --help - twrt --version - twrt post ... - twrt build -Try: twrt post "Lorem Impsum" - twrt build +Usage: + twrt --help Displays list of currently available commands. + twrt --version Displays the current version and date of release. + twrt post ... Generates a new image, 'transmissions.json' file and a Mastodon post with the caption. + twrt build Generates the rest of the website using the templates on 'src/templates'. +Try: + twrt post "Lorem Impsum" + twrt build """ import @@ -27,15 +29,7 @@ let generate_card = pyImport("generate_card") -var args = docopt(doc) -#echo args - -#if args["-v"]: -# #echo unicode.capitalize(repeat("very ", args["-v"].len - 1) & "verbose") -# echo args["-v"] - -if args["--version"]: - echo "The Weird Radio Transmitter\nv1.0.0\n2023-02-07" +var args = docopt(doc, help=true, version="The Weird Radio Transmitter\nv1.0.1\n2023-02-09") if args["post"]: var caption = args[""][0] @@ -55,8 +49,6 @@ if args["post"]: uploadTransmission(id) echo "Posting to Mastodon..." postStatus(caption) - #for kind, path in walkDir("export/imgs"): - # echo path if args["build"]: @@ -65,8 +57,3 @@ if args["build"]: buildWebsite() echo "Uploading..." uploadWebsite() - -#echo @(args["--text"]) - -#for path in @(args["--text"]): -# echo read_file(path) \ No newline at end of file diff --git a/twrt.nimble b/twrt.nimble index 04acfe7..4618440 100644 --- a/twrt.nimble +++ b/twrt.nimble @@ -1,8 +1,8 @@ # Package -version = "0.1.0" +version = "1.0.1" author = "exitcas" -description = "The software powering the 'Weird Radio Message' Mastodon account and website." +description = "The software powering the 'Weird Radio Messages' Mastodon account and website." license = "MIT" srcDir = "src" bin = @["twrt"] @@ -13,4 +13,4 @@ bin = @["twrt"] requires "nim >= 1.4.8" requires "docopt >= 0.6.7" requires "nimpy >= 0.2.0" -requires "regex >= 0.11.1" \ No newline at end of file +requires "regex >= 0.11.1"