forked from tilderadio/radiobot
add colors!
This commit is contained in:
parent
e2568c70da
commit
400afc4afe
2
bot.sh
2
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
|
||||
|
|
18
webhook.php
18
webhook.php
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue