A PHP script to show current QTSS song on the web
Dec 22, '02 05:13:43PM • Contributed by: Anonymous
Dec 22, '02 05:13:43PM • Contributed by: Anonymous
Here is a script that will display the currently playing track info from QT SS on a web page using php.
This was basically written by vonleigh with help from nosaj56 in the forums - thanks guys!
This was basically written by vonleigh with help from nosaj56 in the forums - thanks guys!
<?phpYou might need to change the permisions of the playlist directory with chmod 777 to get it to work.
// Define path to playlist.current
// Change to match your playlist name and path
$path = "/path/to/QTSS/playlist.current";
// Read playlist.current into $file
$file = fopen($path, "r");
// Read the contents of $file into $content
$content = fread ($file, filesize($path));
// Separate into parts and put in $info array
$info = explode("/",$content);
// Delete .mp3
$song = substr($info[5], 0, -4);
// Make sure to close after you open
fclose($file);
// Print the information
echo "<br> Track: $song <br>";
echo "<br> Album: $info[4] <br>";
echo "<br> Artist: $info[3] <br>";
?>
•
[4,641 views]
