/ Published in: PHP
Expand |
Embed | Plain Text
<html> <? // Set up the CURL object $ch = curl_init( "http://www.metacritic.com/video/" ); // Fake out the User Agent curl_setopt( $ch, CURLOPT_USERAGENT, "Internet Explorer" ); // Start the output buffering // Get the HTML from MetaCritic curl_exec( $ch ); curl_close( $ch ); // Get the contents of the output buffer // Get just the list sorted by name $str, $byname ); // Get each of the movie entries $byname[0], $moviedata ); // Work through the raw movie data { // The score is ok already $score = $moviedata[1][$i]; // We need to remove tags from the title and decode // the HTML entities $title = $moviedata[2][$i]; // Then add the movie to the array } ?> <body> <table> <tr> <th>Name</th><th>Score</th> </tr> <? foreach( $movies as $movie ) { ?> <tr> </tr> <? } ?> </table> </body> </html>
You need to login to post a comment.
