help to fetch this web

Discussion in 'Programming' started by syariscrewz, Mar 1, 2009.

Thread Status:
Not open for further replies.
  1. #1
    i got some problems here,,
    i need your help...
    how can i fecth this??
    <?php
    $url = "http://www.playlist.com/search/tracks/muse/1";

    $res = file_get_contents($url);

    echo $res;

    ?>

    i really need your help
     
    syariscrewz, Mar 1, 2009 IP
  2. sandalian

    sandalian Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you get some error?

    Or, are you trying to get the list? If so, you must use some regex to parse the result.
     
    sandalian, Mar 1, 2009 IP
  3. syariscrewz

    syariscrewz Banned

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for trying to help me..

    but my truly problem is i want fetch that web to make like this

    <?php
    function kerat($content,$start,$end){
    if($content && $start && $end) {
    $r = explode($start, $content);
    if (isset($r[1])){
    $r = explode($end, $r[1]);
    return $r[0];
    }
    return '';
    }
    }

    $search = str_replace(' ' ,'+', $_GET[search]);






    $uurl = "http://www.bomb-mp3.com/index.php?search=".$search."&p=".$p;


    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $uurl);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
    $res = curl_exec($ch);
    curl_close($ch);

    $res = kerat($res,'height="79px" width="559px">','</table>');
    $res = explode('<tr><td colspan="2">&nbsp;</td></tr>',$res);

    for($i=0;$i<25;$i++){//25

    $str = $res[$i];
    $str =strstr($str,'<a href=');
    $name = kerat($str,'">','</a><br />');
    $name = str_replace('.mp3','',$name);


    $id = kerat($str,'mp3_id=','&title');

    $link = "http://www.bomb-mp3.com/go.php?id=".$id;
    $link = trim($link);

    echo $link;
    echo "<br>";
    echo $name;
    echo "<br>";
    }

    ?>

    its success if i fetch boom-mp3.com . to get the link and name of song.

    but if i fetch playlist.com . its happen in diffrent thing, no result will found. thanks for trying help me.
     
    syariscrewz, Mar 3, 2009 IP
Thread Status:
Not open for further replies.