Created
August 10, 2009 12:28
-
-
Save Voker57/165164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// RIP LyricWiki. You were rather good. | |
// This script has the same interface as late LyricWiki | |
// Returning format is html only | |
error_reporting(0); | |
function encode($wtf) | |
{ | |
return urlencode(preg_replace("/\\s+/","_",$wtf)); | |
} | |
$artist = encode($_REQUEST["artist"]); | |
$title = encode($_REQUEST["song"]); | |
$page = file_get_contents("http://lyricwiki.org/$artist:$title"); | |
if(preg_match("/<div\\s*class='lyricbox'\\s*>(.*)<\\/div\\s*>/msU",$page,$matches)) | |
{ | |
echo $matches[1]; | |
} else | |
{ | |
echo "Sorry, no matches"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment