| I am looking for a "how-to" to create a module which pulls in the top 3 stories from the BBC with pics. the code is below: $handle = fopen ("http://news.bbc.co.uk/2/low.html", "rb"); $rf = ""; do { $data = fread($handle, 8192); if (strlen($data) == 0) { break; } $rf .= $data; } while(true); $grab = eregi( "<a name=\"startcontent\"></a>(.*)OTHER TOP STORIES", $rf, $printing ); $printing[ 1 ] = str_replace( "<a name=\"startcontent\"></a>", "<TABLE WIDTH=\"100%\" CELLPADDING=\"0\" CELLSPACING=\"0\"><TR><TD VALIGN=\"TOP\" WIDTH=\"10\" ALIGN=\"LEFT\">» </TD><TD ALIGN=\"LEFT\" WIDTH=\"100%\">", $printing[ 1 ] ); $printing[ 1 ] = str_replace( "/2/low/", "http://news.bbc.co.uk/2/hi/", $printing[ 1 ] ); $printing[ 1 ] = str_replace( "<br /><clear=\"all\" />", "", $printing[ 1 ] ); $printing[ 1 ] = str_replace( "<br /><br />", "", $printing[ 1 ] ); $printing[ 1 ] = str_replace( "<hr>", "", $printing[ 1 ] ); $printing[ 1 ] = str_replace( "<br /><p>", "", $printing[ 1 ] ); fclose( $handle ); $content = $printing[ 1 ]."<p align=\"center\"><a href=\"http://news.bbc.co.uk\" target=\"_blank\"><img border=\"0\" src=\"images/blocks/bbcnews.gif\"></a></p>"; |
Forum 





Author



Logged





