From 6726a6937908756643e6f058b611da0d2ff1e014 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 14 Nov 2023 06:15:28 +0100 Subject: [PATCH] docs: added readme --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..746b35f --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# mood +this is a silly little project to model my volatile mood + +can you [find](https://api.alemi.dev/mood) 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 (: