5 This will search and show lyrics of specified song from lyricsplugin.com...
6 If you need WinAmp or WMP plug-in, look here: http://www.lyricsplugin.com/
8 ///FUNCTIONS////////////////////////////////////////////////////////////////
9 function get_lyrics($artist, $title) { //Finds and returns lyrics of song
10 $title = urlencode($title);
11 $artist = urlencode($artist);
12 $url = "http://www.lyricsplugin.com/plugin/?artist=$artist&title=$title";
13 //readfile($url); //Debug
14 if( !($fp = fopen($url, "r")) ) return("Error_1: Can't connect!");
17 while( ($line = trim(fgets($fp))) != "<div id=\"lyrics\">" );
18 while( ($line = trim(fgets($fp))) != "</div>" ) {
19 $line = strip_tags($line);
21 $lyrics = $lyrics.$line."\n";
24 $lyrics = trim($lyrics);
25 if($lyrics == "") $lyrics = "Error_2: Lyrics not found!";
29 function parse_music_info($filename) { //This returns array with music info (0 => Artist, 1 => Title) parsed from filename
30 $filename = explode("-", $filename);
31 $ret[0] = $filename[0];
32 $filename = split("(-|\\.)", $filename[1]);
33 $ret[1] = $filename[0];
35 $ret = str_replace("_", " ", $ret);
36 $ret[0] = trim($ret[0]);
37 $ret[1] = trim($ret[1]);
38 //print_r($filename); //Debug
39 //print_r($ret); //Debug
43 ///CODE/////////////////////////////////////////////////////////////////////
44 $song = parse_music_info("Jimi_Hendrix_-_Are_you_experienced.mp3");
45 echo("Lyrics for: ".$song[1]." by: ".$song[0]."\n\n");
46 echo get_lyrics($song[0] ,$song[1])."\n";
47 //echo get_lyrics("Jimi Hendrix" ,"Are you experienced");
This page took 1.00945 seconds and 4 git commands to generate.