Wednesday, April 8, 2009

php script to update song info using command line


/*
* Script By Mynux Team 2008
*
* I use this script to update the song info as advertisement
* for a running shoutcast server and running with cron.
*
* http://www.mynux.net
*/

/************** EDIT HERE ONLY **********/

$host = "my.fm";
$port = "8000";
$scpass = "adminpass";
//the text in between cannot have blank space. put %20 between them
$msg = "Radio%20Manis%20-%20Powered%20by%20www.mynux.net";

/**************** END HERE **************/

$fp = fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)
\n";
} else {
$out = "GET /admin.cgi?mode=updinfo&song=$msg HTTP/1.1\r\n";
$out .= "Host: $host:$port\r\n";
$out .= "Accept: */*\r\n";
$out .= "User-Agent: MynuxCast Song (Mozilla Compatible)\r\n";
$out .= "Authorization: Basic ".base64_encode("admin:$scpass")."\r\n\r\n";
fputs($fp,$out);
fclose($fp);
}
?>

No comments:

 Simple Python Calculator This script will allows your to calculate the integers given with the chosen operation. You can add, substract, mu...