GridTalk.de
Radioplaylist / Infos on a Prim - Druckversion

+- GridTalk.de (https://www.gridtalk.de)
+-- Forum: Werkstatt (https://www.gridtalk.de/forumdisplay.php?fid=4)
+--- Forum: Scripting (https://www.gridtalk.de/forumdisplay.php?fid=23)
+--- Thema: Radioplaylist / Infos on a Prim (/showthread.php?tid=4534)

Seiten: 1 2 3 4


RE: Web on a Prim - Xenos Yifu - 29.12.2022

Auf die Idee bin ich noch gar nicht gekommen, das habe ich sogar installiert.


RE: Web on a Prim - Dorena Verne - 29.12.2022

Kannst ja berichten, ob es damit geklappt hat. Wink


RE: Web on a Prim - Xenos Yifu - 29.12.2022

Nichts zu machen, auch Nmap kommt nicht an den Port.
Weiß gar nicht, warum die Ports verschleiern.


RE: Web on a Prim - Xenos Yifu - 29.12.2022

Tja hat sich leider erledigt mit dem Radioboard .... Sad

Da ist das Problem. > Es wird Shoutcast unterstützt, LautFM nutzt aber kein Shoutcast.
Auch Icecast dürfte nicht funktionieren, da der Server auf den sich Hörer verbinden ein AIS ist, der die Schnittstellen von Shoutcast und Icecast nicht besitzt.


RE: Web on a Prim - nihal - 09.01.2023

Hoi
was suchst du? So was wie das hier?

PHP-Code:
<?php

/* benötigt apche/nginx + php
 * ins verzeichnis stationslogo "radio-logo.png" reinwerfen, wird anstelle fehlenes kuenstlerbild angezeigt
 * #736b61
*/
//der stationsname
$station "xenolandia";

//stationsinfos aus api abrufen und aufbereiten
$json_song file_get_contents("http://api.laut.fm/station/".$station."/current_song");
$obj_song json_decode($json_song); 

$json_listeners file_get_contents("http://api.laut.fm/station/".$station."/listeners");
$obj_listeners json_decode($json_listeners);

$json_next_artists file_get_contents("http://api.laut.fm/station/".$station."/next_artists");
$obj_next_artists json_decode($json_next_artists);

$json_station file_get_contents("http://api.laut.fm/station/".$station);
$obj_station json_decode($json_station);

$json_last_songs file_get_contents("http://api.laut.fm/station/".$station."/last_songs");
$obj_last_songs json_decode($json_last_songs);

//systemzeit und song-ende-zeit in sekunden umrechnen 
list($sdatum$szeit$szone) = explode(" "$obj_song->started_at );
list(
$sdatum$ezeit$szone) = explode(" "$obj_song->ends_at );
list(
$stunde$minute$sekunde) = explode(":"$ezeit );
list(
$sysstunde$sysminute$syssekunde)= explode(":"date("H:i:s") );
$songzeit $stunde 3600 $minute *60 $sekunde;
$syszeit $sysstunde 3600 $sysminute *60 $syssekunde;
//korrektur datumswechsel und berechnen der refreshzeit der seite
if ($songzeit $syszeit){
    
$zeit $songzeit $syszeit;
}
else {
    
$zeit $songzeit $syszeit 86400 ;
}
?>

<html>

<head>
<title>"Radio-Board"</title>
<meta content="text/html;charset=utf-8" http-equiv="content-type">
 <?php
 
echo '<meta http-equiv="refresh" content= "' $zeit'" >';
   
?>
</head>

<body style="background-color:#534b41">
     
    <table style="width:100%;background-color:#232323">
        <tr>
            <th style="width:50%;background-color:#736b61">     
            <?php
                
// Stationsinfos anzeigen:
                
echo '<br>';
                echo 
'Stationsname: <a href="http://laut.fm/' $obj_station->name '">' $obj_station->name  '</a><br><br>';
                echo 
'Stream_URL: <a href="' $obj_station->stream_url .  '"> http://stream.laut.fm/xenolandia</a><br><br>';
            
?>
            </th>
        </tr>    
    </table>

    <table style="width:100%;background-color:#232323">
      <tr>
            <th style="width:50%;background-color:#736b61">
                <?php
                
//aktuellen song anzeigen
                
echo '<br> aktueller Song: ' $szeit ' - ' $ezeit '<br>';
                echo 
'<br>' $obj_song->artist->name ' - ' $obj_song->title '<br>';
                
// Bild anzeigen, wenn's eins gibt ansonsten stationslogo "radio-logo.png":
                
if ( $obj_song->artist->image ) {
                    echo 
'<br>';
                    echo 
'<a href="' $obj_song->artist->laut_url '"><img src="' $obj_song->artist->image '" width="42%" > </a>';
                    echo 
'<br>';
                }
                else{
                    echo 
'<br>';
                    echo 
'<img src="radio-logo.png" width="256px" >';
                    echo 
'<br>';
                }
                
// Zuhoerer anzeigen:
                
echo '<br>';
                echo 
'aktuell Zuhörer: ' $obj_listeners .   '<br>';
                echo 
'<br>';
                
//naechste Interpreten    
                
echo 'gleich läuft: <br>';
                echo 
'<br>';
                echo 
$obj_next_artists[0]->artist->name  .   '<br><br>';
                echo 
$obj_next_artists[1]->artist->name  .   '<br><br>';
                echo 
$obj_next_artists[2]->artist->name  .   '<br><br>';
                
?>
            </th>
                
            <th style="background-color:#736b61">
                <?php
                
//Playlist
                
echo '<h2>Playlist: </h2><br>';
                echo 
'<h3>' $obj_last_songs[0]->artist->name ' : ' $obj_last_songs[0]->title  .   '</h3><br>';
                echo 
$obj_last_songs[1]->artist->name ' : ' $obj_last_songs[1]->title  .   '<br><br>';
                echo 
$obj_last_songs[2]->artist->name ' : ' $obj_last_songs[2]->title  .   '<br><br>';
                echo 
$obj_last_songs[3]->artist->name ' : ' $obj_last_songs[3]->title  .   '<br><br>';
                echo 
$obj_last_songs[4]->artist->name ' : ' $obj_last_songs[4]->title  .   '<br><br>';
                echo 
$obj_last_songs[5]->artist->name ' : ' $obj_last_songs[5]->title  .   '<br><br>';
                echo 
$obj_last_songs[6]->artist->name ' : ' $obj_last_songs[6]->title  .   '<br><br>';
                echo 
$obj_last_songs[7]->artist->name ' : ' $obj_last_songs[7]->title  .   '<br><br>';
                echo 
$obj_last_songs[8]->artist->name ' : ' $obj_last_songs[8]->title  .   '<br><br>';
                echo 
$obj_last_songs[9]->artist->name ' : ' $obj_last_songs[9]->title  .   '<br><br>';
                
?>
            </th>
        </tr>    
    </table>
</body>
</html> 

als PHP Datei auf deinen Server gelegt, apache / nginx und php dazu, stationslogo "radio-logo.png" reinwerfen, für den Fall der Radioserver hat kein passendes Bild.


RE: Web on a Prim - Xenos Yifu - 10.01.2023

Das iss ja mal cool, danke Big Grin

..... wird heute noch umgesetzt. Wink


RE: Web on a Prim - nihal - 11.01.2023

es funktioniert im Übrigen auch mit anderen Sendern, nach einer Änderung und einer Fehlerkorrektur:

zeile 8: $station = "artdestiny";

zeile 61:
falsch (had coded key):
echo 'Stream_URL: <a href="' . $obj_station->stream_url . '"> http://stream.laut.fm/xenolandia</a><br><br>';
richtig:
echo 'Stream_URL: <a href="' . $obj_station->stream_url . '">' . $obj_station->stream_url . '</a><br><br>';

sorry


RE: Web on a Prim - Xenos Yifu - 11.01.2023

Kann ich leider nicht ausprobieren, weil ich ums verrecken den Fehler "Windows-Server CGI lässt sich nicht installieren Fehler: 0x80073701".
Und ohne das CGI Modul kein PHP ... alle gängigen Methoden das zu beheben scheitern.


RE: Web on a Prim - nihal - 12.01.2023

also im Prinzip funktioniert es, Firestorm ja, allerdings im Singularity nicht, wieso auch immer. Das wird aber ein Problem des Viewers sein. Beim Windows Server Problem kann ich leider nicht weiterhelfen aber eventuell ist ja jemand hier der sich damit auskennt.

   


RE: Web on a Prim - Xenos Yifu - 17.01.2023

So, da ich ja Problem mit einem Modul habe und deswegen eine Alternative zu Php brauchte, kommt nun eben Java zum Einsatz. Wink
Vorteil, die Java Version aktualisiert sich selbst, was die Php Variante nicht kann. Smile
So sieht das dann aus ...
Weitere Funktionen kommen nach.