Aller au contenu

Recherche Script radio (shoutcast)


jérémie

Messages recommandés

Bonjour, voici mon problème depuis plusieurs jours je cherche sur le forum un script qui permet de voir pochettes + titre en cours mais aucun ne fonctionne.

Je diffuse la radio à partir de virtual dj et le serveur est hébergé avec shoutcast.

 

merci pour votre aide !

Lien vers le commentaire
Partager sur d’autres sites

  • 2 weeks later...

C'est surtout car à ma connaissance VirtualDJ ne gère pas le titrage, donc il faudra changer de logiciel.

 

Et comme le dit MickA, une passage par les cases "Présentation" + "Recherche" ne sont pas optionnels.

Lien vers le commentaire
Partager sur d’autres sites

  • 1 month later...

Bonjour !

En voici un qui fonctionne avec Shoutcast v1.9.8

Cordialement.

 

<?php
 
$server = "adresse"; // Ip du serveur
$port = "port"; // Port du serveur
$extension = ".mp3";
$listen = "listen.pls";
$date = date("d-m-Y");
$heure = date("H:i:s");
    $fp = @fsockopen($server, $port, $errno, $errstr, 30);
 
    if ($fp) {
        fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
        while(!feof($fp))
            $page .= fgets($fp, 1000);
        fclose($fp);
        $page = ereg_replace(".*<body>", "", $page);
        $page = ereg_replace("</body>.*", ",", $page);
        $numbers = explode(",", $page);
        $shoutcast_currentlisteners = $numbers[0];
        $connected = $numbers[1];
        if($connected == 1) {
            $radio_status = 1;
            $wordconnected = "yes";
        }
        else
            $wordconnected = "no";
        $shoutcast_peaklisteners = $numbers[2];
        $shoutcast_maxlisteners = $numbers[3];
        $shoutcast_reportedlisteners = $numbers[4];
        $shoutcast_bitrate = $numbers[5];
        $shoutcast_cursong = $numbers[6];
        $shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners;
        $shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners;
    }
function suppr_accents($str, $encoding='windows-1252')
{
$str = htmlentities($str, ENT_NOQUOTES, $encoding);
$str = preg_replace('#&([A-za-z])(?:acute|grave|cedil|circ|orn|ring|slash|th|tilde|uml);#', '\1', $str);
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str);
$str = preg_replace('#&[^;]+;#', '', $str);
return $str;
}
$shoutcast_cursong_l = suppr_accents($shoutcast_cursong);
?>
<html>
<head>
<title>Shoutcast infos</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="10"; url="shoutcast_infos.php">
<style type="text/css">
body {
background-color: #FFFFFF;
margin: 8px 8px 8px 8px;
text-align: left;
color: #000000;
font-family: Verdana;
font-size: 14px;
}
a:link {
color: #FF0000;
text-decoration: underline;
}
a:visited {
color: #FF0000;
text-decoration: underline;
}
a:active {
color: #FF0000;
text-decoration: underline;
}
a:hover {
color: #000000;
text-decoration: underline;
}
</style>
    <script src="//www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
    /*
    *  How to search for images and restrict them by size.
    *  This demo will also show how to use Raw Searchers, aka a searcher that is
    *  not attached to a SearchControl.  Thus, we will handle and draw the results
    *  manually.
    */
    
    google.load('search', '1');
    
    function searchComplete(searcher) {
      // Check that we got results
      if (searcher.results && searcher.results.length > 1) {
        // Grab our content div, clear it.
        var contentDiv = document.getElementById('content');
        contentDiv.innerHTML = '';
    
        // Loop through our results, printing them to the page.
        var results = searcher.results;
        for (var i = 3; i < results.length; i++) {
          // For each result write it's title and image to the screen
          var result = results;
          var imgContainer = document.createElement('p');
    
 
    
          var newImg = document.createElement('img');
          // There is also a result.url property which has the escaped version
          newImg.src = result.tbUrl;
   
          imgContainer.appendChild(newImg);
    
          // Put our title + image in the content
          contentDiv.appendChild(imgContainer);
        }
      }
    }
<?php
if ($radio_status == 1) {
 
    echo "function OnLoad() {
      // Our ImageSearch instance.
      var imageSearch = new google.search.ImageSearch();
    
      // Restrict to extra large images only
      imageSearch.setRestriction(google.search.ImageSearch.RESTRICT_IMAGESIZE,
                                 google.search.ImageSearch.IMAGESIZE_MEDIUM);
    
      // Here we set a callback so that anytime a search is executed, it will call
      // the searchComplete function and pass it our ImageSearch searcher.
      // When a search completes, our ImageSearch object is automatically
      // populated with the results.
      imageSearch.setSearchCompleteCallback(this, searchComplete, [imageSearch]);
    
      // Find me a beautiful car.
      imageSearch.execute(\"" . $shoutcast_cursong_l . "\");
    }
    google.setOnLoadCallback(OnLoad);";
}
?>
 
 
    </script>
</head>
  <body style="font-family: Arial;border: 0 none;">
<?php
if ($radio_status == 1) {
    echo '<div id="content">Loading...</div>';
}    
    else {
        echo 'OFF AIR';
}
?>
    
</body>
</html>
Lien vers le commentaire
Partager sur d’autres sites

Je n'y connait rien en titrage php... je ne vois meme pas comment intégrer la réponse de ce script php a ma page html.
J'utilise un script jquery, mais il ne gere pas les accents. Ceux qui ont un peu de patience peuvent m'apprendre.
(attention, je n'ai plus 15 ans, la compréhension est donc plus lente ;) )

Lien vers le commentaire
Partager sur d’autres sites

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

×
×
  • Créer...