Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pfadweg = "//deine-domain.de/uploads/";
- $bildformat = "png";
- // Hier kannst du die Hoehe des Bildes einstellen.
- $hoehe = "150";
- // Hier kannst du die Breite des Bildes einstellen.
- $breite = "150";
- ?>
- <?php
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>OnAir</title>
- <meta content='text/html;charset=utf-8' http-equiv='content-type'>
- </head>
- <body>
- <?php
- // Um welche Station handelt sich's:
- $sid = "8";
- // Die Stations-Infos aus der API abfragen:
- $json_station = file_get_contents("https://stream.project-radio.eu/api/nowplaying/".$sid);
- // zu Debuggen einkommentieren:
- // var_dump($http_response_header);
- // var_dump($json_station);
- // Die Anwort von JSON in einen assoziativen Object umwandeln:
- $obj_station = json_decode($json_station);
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <link rel="stylesheet" href="style.css">
- <title>Streamanzeige</title>
- <script src="jquery.min.js"></script>
- <script>
- $(document).ready(function(){
- setInterval(function(){
- $("#cs").load('song.php')
- }, 30000);
- });
- </script>
- </head>
- <body>
- <div class="container-fluid">
- <div class="row">
- <div class="col-sm-12 col-md-12 col-lg-12">
- <div class="row">
- <div class="col-md-3 col-lg-2 col-sm-12 col-xs-12">
- <p>
- <?php if (empty($obj_station->live->streamer_name)){
- echo "Playlist";
- } else {
- echo $obj_station->live->streamer_name;
- } ?>
- echo('<img src='.$pfadweg.''.$string.'.'.$bildformat.' width="'.$breite.'" height="'.$hoehe.'">');
- </p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement