Add webhook code (from ben/radiobot)
This commit is contained in:
parent
3a1ddac115
commit
cc9ce6041b
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
$json = json_decode(file_get_contents('php://input'));
|
||||
|
||||
$resp = array();
|
||||
|
||||
if ($json->live->is_live) {
|
||||
$resp["dj"] = $json->live->streamer_name;
|
||||
} else {
|
||||
$resp["dj"] = NULL;
|
||||
}
|
||||
|
||||
$resp["song"] = $json->now_playing->song->text;
|
||||
$resp["listeners"] = $json->listeners->current;
|
||||
|
||||
file_put_contents("now_playing.json", json_encode($resp));
|
||||
|
Loading…
Reference in New Issue