View previous topic :: View next topic |
Author |
Message |
ayuda Guest
|
Posted: Tue Oct 11, 2005 1:41 am Post subject: ayuda |
|
|
kiero poner en mi web que me salga el dj online los oyentes y la canciones pasada y la que esta puesta se hacerlo con sohoutcast pero con icecast no ayuda |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Tue Apr 04, 2006 2:22 pm Post subject: |
|
|
Tenés una página de estadísticas en http://$ip:$puerto/status.xsl
de ahi podes tomar los datos que necesitas y publicarlos donde quieras, probablemente necesites hacer un pequeños script que los capture, ej: en php. |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Tue Apr 04, 2006 3:48 pm Post subject: |
|
|
Aca tenes un script simple, que captura los datos de un status_bls.xsl que tenes que subir al servidor icecast en: /usr/local/share/icecast/web/
crear un archivo llamado status_bls.xsl que contenga lo siguente:
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<!--<HTML>
<HEAD>
<meta http-equiv="pragma" content="no-cache" />
</HEAD>
<BODY>-->
<xsl:value-of select="source_connections" /><xsl:value-of select="listeners" />
<xsl:for-each select="source">
<xsl:value-of select="@mount" />|||
<xsl:value-of select="listeners" />|||
<xsl:value-of select="bitrate" />|||
<xsl:value-of select="artist" /><xsl:value-of select="title" />|||
<xsl:value-of select="stream_start" />|||
<xsl:value-of select="server_description" />|xx|
</xsl:for-each>
<!--</BODY>
</HTML>-->
</xsl:template>
</xsl:stylesheet>
Una vez que tengas ese archivo, podés hacer un script como este (ejeplo) en php, subilo a tu servidor web y nombralo como quieras, lo vas a acceder de esta forma: http://tu.numero.ip.odominio:puerto/pagina.php?mount=/stream
<head>
<style type="text/css">
<!--
.style3 {
font-family: tahoma;
font-size: 10px;
color: #00455A;
}
.styleErr2 {
font-family: tahoma;
font-size: 10px;
color: #FF0000;
}
body, td {
font-family: tahoma;
font-size: 11px;
}
</style>
</head>
<?php
$mountpoint = trim($_GET['mount']);
$ip = "tuhost.o.direccion.ip";
$port = "puerto";
$lines = file("http://$ip:$port/status_bls.xsl");
$exp = implode(" ", $lines); $exp = explode("|xx|", $exp);
$count = count($exp);
for ($i = 0; $i < $count; $i++) {
$dos = explode("|||", $exp[$i]);
if ($mountpoint == trim($dos[0])) {
$check = $dos[0];
if (($dos[0] == '') && (!isset($dos[0]))) { $mount = "Sin conexión"; } else { $mount = "ONLINE ($mountpoint)"; }
if (($dos[1] == '') && (!isset($dos[1]))) { $oyentes = "0"; } else { $oyentes = trim($dos[1]); }
if (($dos[2] == '') && (!isset($dos[2]))) { $bitrate = "0"; } else { $bitrate = trim($dos[2]); }
if (($dos[3] == '') && (!isset($dos[3]))) { $repro = "-"; } else { $repro = trim($dos[3]); }
if ($bitrate == '') { $bitrate = "No disponible"; } else { $bitrate = $bitrate." kbps"; }
}
}
?>
<table style="padding: 2px 2px 2px 2px;border-width:1px;border-color:#ABABAB" width="488" cellspacing="2" cellpadding="0">
<tr>
<td width="106" bgcolor="#EAEAEA">Estado</td>
<td width="10"> </td>
<td width="280" style="border-width:1px; border-bottom-style:dashed; border-bottom-color:#969696"><span class="<?php if (isset($check)) { echo "style3"; } else { echo "styleErr2"; } ?>"><?php if (isset($check)) { echo $mount; } else { echo "OFFLINE"; } ?></span></td>
<td width="17" rowspan="4"> <div align="center"></div></td>
<td width="63" rowspan="4" bgcolor="#EAEAEA"></td>
</tr>
<tr>
<td bgcolor="#EAEAEA">Compresión</td>
<td> </td>
<td style="border-width:1px; border-bottom-style:dashed; border-bottom-color:#969696"><?php echo $bitrate; ?></td>
</tr>
<tr>
<td bgcolor="#EAEAEA">Oyentes</td>
<td> </td>
<td style="border-width:1px; border-bottom-style:dashed; border-bottom-color:#969696"><?php echo $oyentes; ?></td>
</tr>
<tr>
<td bgcolor="#EAEAEA">Reproduciendo</td>
<td> </td>
<td style="border-width:1px; border-bottom-style:dashed; border-bottom-color:#969696"><?php echo $repro; ?></td>
</tr>
</table>
Espero te de alguna idea este script |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|