last songs played
last songs played
I've noticed that the only way listernes can see the 10 last songs played are on a page where there's also a logon and other things.
Is it possible to get ONLY the 10 last songs played?
- prideplay
- Posts: 3
- Joined: Thu 14th Jan, 2010 6:38 am
Re: last songs played
Download the Shoutcast class and try this php script.
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Shoutcast Test Page</title>
<style type="text/css">
.songOverview {
width:30%;
border:1px solid black;
background-color: #EEE;
}
.songOverview td {
padding: 1px 10px 1px 1px;
}
</style>
</head>
<body>
<?php
require_once ('shoutcast_class.php');
///YOUR RADIO CONFIGURATION IP & PORT///
$ip = "stream_address_here";
$port = "port_here";
////////////////////////////////////////
$radio = new Radio($ip.":".$port);
// ALL POSSIBLE INFORMATION //
$display_array = array(
"Stream Title",
"Stream Genre",
"Stream URL",
"Current Song",
"Server Status",
"Stream Status",
"Listener Peak",
"Average Listen Time",
"Content Type",
"Stream AIM",
"Stream IRC"
);
$data_array = $radio->getServerInfo($display_array);
echo "<table style=\"background-color: #CCC; border: 1px solid black;\">\n";
if (is_array($data_array))
{
foreach ($display_array AS $i => $text)
{
if ($text == "Stream Genre")
{
$datastring = "<span style=\"color: lightgrey; background-color: black;\">".$data_array[$i]."</span>";
}
elseif ($text == "Stream URL")
{
$datastring = "<a href=\"".$data_array[$i]."\" target=\"_blank\">".$data_array[$i]."</a>";
}
else
{
$datastring = $data_array[$i];
}
echo "<tr>\n <td>".$text.":</td>\n";
echo " <td>".$datastring."</td>\n</tr>\n";
}
}
else
{
echo "<tr>\n <td colspan=\"2\" style=\"color: red;\">".$data_array."</td>\n</tr>\n";
}
echo "</table>\n";
/*SONG HISTORY*/
echo "<h2>Song History</h2>\n";
echo $radio->getHistoryTable("/played.html", "<b>Played At</b>", "<b>Song</b>", "songOverview");
?>
</body>
</html>
- Ferik
- Posts: 10
- Joined: Thu 14th Jan, 2010 11:37 am
Re: last songs played
- Gavin
- Site Admin
- Posts: 139
- Joined: Thu 01st Jan, 1970 1:00 am
Re: last songs played
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>myRadio Test Page</title>
<style type="text/css">
.myRadio {
width:30%;
border:1px solid black;
background-color: #EEE;
}
.myRadio td {
padding: 1px 10px 1px 1px;
}
</style>
</head>
<body>
<?php
require_once ('shoutcast_class.php');
///YOUR RADIO CONFIGURATION IP & PORT///
$radio_ip = "stream_address_here";
$radio_port = "port_here";
$my_radio = new Radio($radio_ip.":".$radio_port);
/*SONG HISTORY*/
echo "<h2>Song History</h2>\n";
echo $my_radio->getHistoryTable("/played.html", "<b>Played At</b>", "<b>Song</b>", "myRadio");
?>
</body>
</html>
- Ferik
- Posts: 10
- Joined: Thu 14th Jan, 2010 11:37 am
Return to Streaming Discussion
Who is online
Users browsing this forum: No registered users and 1 guest

