<?php
# Imeem PHP class
# used for embedding songs on web page without single line of HTML code
#
# Dedicated to my beloved brother FILIP. Rest in peace!
#
# by Avram, www.avramovic.info
class Imeem {
function GetSongIdFromUrl($url) {
//get remote file (html code)
$rf = fopen($url,'r');
$html = '';
while (!feof($rf)) {
$html .= fread($rf,512);
}
//parse remote file and get real song ID
preg_match_all('/http:\/\/media\.imeem\.com\/m\/(.*)"/', $html, $z);
$nj = $z[1][0];
$a = explode('"',$nj);
$id = $a[0];
return $id;
}
function EmbedSong($songid, $autoplay = true, $width = 300, $height = 80) {
return '<object width="'.$width.'" height="'.$height.'"><param name="movie" value="http://media.imeem.com/m/' . $songid . ((!$autoplay) ? '/aus=false/' : '') . '"></param><param name="wmode" value="transparent"></param><embed src="http://media.imeem.com/m/' . $songid . ((!$autoplay) ? '/aus=false/' : '') . '" type="application/x-shockwave-flash" wmode="transparent" width="'.$width.'" height="'.$height.'"></embed></object>';
}
}
?>