Jump to content

Mp3 search engine


Sweetz

Recommended Posts

I have this Mp3 search engine.......Results show song legnth and song time. Plus a button to play the track. I'm looking to add the actual link location along w/ the other info (song legnth and song time).

 

Is that possible w/ the code below?

 

Thanks!

 

My code:

// mp3realm.org

$value = $_GET['mp3'];
$value = str_replace(' ', '+', $value);
$value = str_replace('%20', '+', $value);
$strona = $_GET['pp_idPagera'];
$target = file_get_contents('http://mp3realm.org/search?q='.$value.'&dur=0&pp=50&page='.$strona.'');
preg_match_all('/<font color=\'#1875bf\'>(.*)<\/font>/', $target, $title_realm);
preg_match_all('/<div id="textrcolumn"><h4>Playtime <\/h4>(.*)<\/div>/', $target, $playtime);
preg_match_all('/(.*) MB -/', $target, $size);
preg_match_all('/<a href=\'url?(.*)\'>/', $target, $link_download);
preg_match_all('/<li><a href="(.*)q=(.*)&dur=(.*)&pp=(.*)&page=(.*)">(.*)<\/a><\/li>/', $target, $pages);

$how_much_mp3 = count($title_realm[1]);
if(empty($title_realm[1])) {
echo 'No results for: <strong>'.$value.'</strong>';
}
if(!empty($title_realm[1])) {
for($i=0;$i<$how_much_mp3;$i++) {
$title_realm[1][$i] = strip_tags($title_realm[1][$i]);
$link_download[1][$i] = str_replace('?', '', $link_download[1][$i]);
echo '<a href="more/mp3/realm/'.$link_download[1][$i].'.html">'.$title_realm[1][$i] . 
'</a><br /><strong>'.$playtime[1][$i].' | '.$size[1][$i].' MB</strong><br /><br />';
}
}
$how_much_pages = count($pages[6])+1;
// create pages 
for($i=1;$i<$how_much_pages;$i++) {
echo '<a href="search/realm/'.$value.'/'.$i.'">'.$i.'</a> ';
}
}

// end mp3realm.org

 

Link to comment
https://forums.phpfreaks.com/topic/103558-mp3-search-engine/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.