i was using the below codes for ages to 'steal' the top 10/40 singles from Radio 1 page, and now they have suddenly decided to change there coding... would anyone please be able to adapt mine to 'steal' theres once again... Thanks in advanced <?php $data = file_get_contents("http://www.bbc.co.uk/radio1/chart/singles.shtml"); preg_match_all('%<td class="col1">(\d+?)</td>.+?src="(.+?)".+?<h4>(.+?)</h4>.+?<h5>(.+?)</h5>%sm', $data, $result, PREG_PATTERN_ORDER); $num_elements = count($result); ?> <?php for($i = 0; $i < 10; $i++) { echo "<tr><td class='td2' align='center'>".$result[1][$i]."</td><td class='td2' align='center'><img src='".$result[2][$i]."' width='70' height='70' alt='' border='0' /> </td><td class='td2' align='center'>".$result[3][$i]."</td><td align='center'>".$result[4][$i]."</td></tr>"; } ?> PHP: there new website address is http://www.bbc.co.uk/radio1/chart/singles/
I think this will do what you want: <?php $data = file_get_contents("http://www.bbc.co.uk/radio1/chart/singles/"); preg_match_all('/<span class="position">(\d+?)\s*<\/span>.+?src="(.+?)".+?<span class="artist">(.+?)\s*<\/span>.+?<span class="track">(.+?)\s*<\/span>/sm', $data, $result); $num_elements = count($result); ?> <?php for($i = 0; $i < 10; $i++) { echo "<tr><td class='td2' align='center'>".$result[1][$i]."</td><td class='td2' align='center'><img src='".$result[2][$i]."' width='70' height='70' alt='".$result[3][$i]."' border='0' /> </td><td class='td2' align='center'>".$result[3][$i]."</td><td align='center'>".$result[4][$i]."</td></tr>"; } ?> PHP:
THEY HAVE CHANGED THERE CODE SLIGHTLY AGAIN!!! i am still using the above code however the images are now NOT working, i believe they have changed the way they link the images can anyone help plz
Here you go, they just removed "http://www.bbc.co.uk/" from there own image string. <?php for($i = 0; $i < 10; $i++) { echo "<tr><td class='td2' align='center'>".$result[1][$i]."</td><td class='td2' align='center'><img src='http://www.bbc.co.uk/".$result[2][$i]."' width='70' height='70' alt='".$result[3][$i]."' border='0' /> </td><td class='td2' align='center'>".$result[3][$i]."</td><td align='center'>".$result[4][$i]."</td></tr>"; } ?>