From 400afc4afe1b97b46e126aa084723126d0c2046e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 24 Oct 2018 01:28:49 -0400 Subject: [PATCH] add colors! --- bot.sh | 2 +- webhook.php | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bot.sh b/bot.sh index d1f2bfc..41874ba 100644 --- a/bot.sh +++ b/bot.sh @@ -16,7 +16,7 @@ do # now playing if [[ $now_playing != "$(<$now_playing_file)" ]]; then now_playing=$(<$now_playing_file) - echo "PRIVMSG #tilderadio :Now Playing on tilderadio: $now_playing" >> $input + echo "PRIVMSG #tilderadio :$now_playing" >> $input fi # do things when you see output diff --git a/webhook.php b/webhook.php index 3cd4208..a891522 100644 --- a/webhook.php +++ b/webhook.php @@ -1,6 +1,14 @@ now_playing->song->text -); + +$json = json_decode(file_get_contents('php://input')); + +$msg = "\x0303"; + +if ($json->live->is_live) + $msg .= "({$json->live->streamer_name}) "; +$msg .= "now playing: "; +$msg .= $json->now_playing->song->text . " "; +$msg .= "~~ {$json->listeners->current} listeners"; + +file_put_contents("now_playing.txt", $msg); +