2023-02-22 10:02:55 +01:00
|
|
|
|
{
|
|
|
|
|
|
lib,
|
2023-02-24 23:10:45 +01:00
|
|
|
|
writers,
|
|
|
|
|
|
miller,
|
|
|
|
|
|
gnused,
|
|
|
|
|
|
curl,
|
|
|
|
|
|
nur,
|
2023-02-22 10:02:55 +01:00
|
|
|
|
}: let
|
2021-11-23 20:56:03 +01:00
|
|
|
|
playlistAPI = "https://radio.lassul.us";
|
2021-05-25 21:07:07 +02:00
|
|
|
|
|
2023-02-24 23:10:45 +01:00
|
|
|
|
sendIRC = writers.writeDash "send-irc" ''
|
|
|
|
|
|
${nur.repos.mic92.ircsink}/bin/ircsink \
|
2021-10-19 22:42:29 +02:00
|
|
|
|
--nick musikkritiker \
|
|
|
|
|
|
--server irc.hackint.org \
|
|
|
|
|
|
--port 6697 \
|
|
|
|
|
|
--secure \
|
|
|
|
|
|
--target '#the_playlist' >/dev/null 2>&1
|
2021-05-25 21:07:07 +02:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
messages.good = [
|
|
|
|
|
|
"what a banger"
|
|
|
|
|
|
"ooh i love this song"
|
|
|
|
|
|
"this is top notch stuff!"
|
|
|
|
|
|
"nice!"
|
|
|
|
|
|
"noice!"
|
|
|
|
|
|
"yesss!"
|
|
|
|
|
|
"cool song!"
|
|
|
|
|
|
"i like this"
|
|
|
|
|
|
"that just sounds awesome!"
|
|
|
|
|
|
"that's a good song!"
|
|
|
|
|
|
"👍"
|
2021-10-19 22:42:29 +02:00
|
|
|
|
"vibin'"
|
2021-05-25 21:07:07 +02:00
|
|
|
|
];
|
|
|
|
|
|
messages.bad = [
|
|
|
|
|
|
"how can anyone listen to this?"
|
|
|
|
|
|
"(╯°□°)╯ ┻━┻"
|
|
|
|
|
|
"skip this!"
|
|
|
|
|
|
"next, please! i'm suffering!"
|
|
|
|
|
|
"that's just bad music"
|
|
|
|
|
|
"nope"
|
|
|
|
|
|
"that sucks!"
|
|
|
|
|
|
"👎"
|
2021-10-19 22:42:29 +02:00
|
|
|
|
"turn that down"
|
2021-11-12 20:22:51 +01:00
|
|
|
|
"make it stooop"
|
|
|
|
|
|
"noooo"
|
2021-05-25 21:07:07 +02:00
|
|
|
|
];
|
2022-05-24 11:09:25 +02:00
|
|
|
|
|
|
|
|
|
|
messages.neutral = [
|
|
|
|
|
|
"meh"
|
|
|
|
|
|
"i have no opinion about this song"
|
|
|
|
|
|
"idk man"
|
|
|
|
|
|
];
|
2021-05-25 21:07:07 +02:00
|
|
|
|
in
|
2023-02-24 23:10:45 +01:00
|
|
|
|
writers.writeDashBin "pls" ''
|
2022-03-10 21:52:12 +01:00
|
|
|
|
case "$1" in
|
|
|
|
|
|
good|like|cool|nice|noice|top|yup|yass|yes|+)
|
2023-02-24 23:10:45 +01:00
|
|
|
|
${curl}/bin/curl -sS -XPOST "${playlistAPI}/good"
|
2022-03-10 21:52:12 +01:00
|
|
|
|
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
|
|
|
|
|
|
;;
|
|
|
|
|
|
skip|next|bad|sucks|no|nope|flop|-)
|
2023-02-24 23:10:45 +01:00
|
|
|
|
${curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
2022-03-10 21:52:12 +01:00
|
|
|
|
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
|
|
|
|
|
|
;;
|
2022-05-24 11:09:25 +02:00
|
|
|
|
0|meh|neutral)
|
|
|
|
|
|
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.neutral)} | shuf -n1 | ${sendIRC}
|
|
|
|
|
|
;;
|
2022-03-10 21:52:12 +01:00
|
|
|
|
say|msg)
|
|
|
|
|
|
shift
|
|
|
|
|
|
echo "$@" | ${sendIRC}
|
|
|
|
|
|
;;
|
|
|
|
|
|
recent)
|
2023-02-24 23:10:45 +01:00
|
|
|
|
${curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
|
2022-03-10 21:52:12 +01:00
|
|
|
|
;;
|
|
|
|
|
|
*)
|
2023-02-24 23:10:45 +01:00
|
|
|
|
${curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
|
|
|
|
|
|
| ${miller}/bin/mlr --ijson --oxtab cat \
|
|
|
|
|
|
| ${gnused}/bin/sed -n '/artist\|title\|youtube/p'
|
2022-03-10 21:52:12 +01:00
|
|
|
|
;;
|
|
|
|
|
|
esac
|
|
|
|
|
|
wait
|
|
|
|
|
|
''
|