1
0
Fork 0
forked from alemi/mood
made the mood actually random and not time based (since i dont actually use it for "moods" lol)
Find a file
2025-01-13 14:31:12 +01:00
src feat: made random 2025-01-13 14:31:12 +01:00
.editorconfig chore: config files 2023-11-14 05:28:49 +01:00
.gitignore chore: updated gitignore 2025-01-13 14:31:06 +01:00
.rustfmt.toml chore: config files 2023-11-14 05:28:49 +01:00
Cargo.toml feat: made random 2025-01-13 14:31:12 +01:00
README.md docs: added readme 2023-11-14 06:15:28 +01:00

mood

this is a silly little project to model my volatile mood

can you find all my rare moods?

how it works

it loads a file containing one entry per line, with its weight prepended:

10 option 1
1 option 2
100 option 3

then picks one option at random respecting weights (meaning, it's 100x more likely to get option3 than option2)

it will print the result to stdout as headers, newline, body (because it's a CGI script, probably run it under fcgiwrap)

important caveat: the random index changes once every minute and is always unique (it will be echoed in the response)

why it's cool

this bin has no dependencies!

also cgi is cool, for such a simple project and since i already had fcgiwrap set up, i could get this going in so little lines!

also it's cool because i made it with love (: