add colors!

This commit is contained in:
Ben Harris 2018-10-24 01:28:49 -04:00
parent e2568c70da
commit 400afc4afe
2 changed files with 14 additions and 6 deletions

2
bot.sh
View File

@ -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

View File

@ -1,6 +1,14 @@
<?php
// this makes a lot of assumptions but it works with azuracast webhooks
file_put_contents(
"now_playing.txt",
json_decode(file_get_contents('php://input'))->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);