18 lines
348 B
PHP
18 lines
348 B
PHP
<?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));
|
|
|