PHPBuilder - Yahoo movie time ripper

RSS Twitter

Yahoo movie time ripper

by: Sam McKone
November 26, 2001

Version: v.1.0

Type: Sample Code (HOWTO)

Category: HTTP

License: GNU General Public License

Description: Get the showtime of movies at any theater listed on Information stored in a 3d array.

// Rip movie show times from a web page
// Sam McKone <>
// 11/9/2001

// Path can be set to any yahoo theater listing, go to
// and search for a city, then click on one of the theaters listed
// than copy the address from the address bar into the path variable
$path = "";

$fp = fopen($path,"r");
        //fpassthru($fp); //just to test if the script works, displays the whole file.
     $times = fread ($fp,100000);
     $times = ereg("<b>Movies and Showtimes</b>(.*)<b>Legend</b>", $times,$content);
     $times = strip_tags($content[0]);
     $times = ereg_replace("&nbsp;"," ",$times);
     $times = ereg_replace("Movies and Showtimes","",$times);
     $times = ereg_replace("Legend","",$times);
     $times = ereg_replace("\n\n","\n",$times);
     $movie = split("\n    \n",$times);
       // get the theater name from $path
        $theater = ereg_replace("&t=","",$theater[0]);
        $theater = ereg_replace("&a(.*)","",$theater);
        $theater = ereg_replace("%20"," ",$theater);
     for($i = 0;$i < count($movie);$i++){
        $movie[$i] = split("\n",$movie[$i]);
     // sample of how to display the movie info
     print "<b>" . $theater . "</b><p>";
     for($i = 0; $i < count($movie);$i++){
         print $movie[$i][0] . "<br>";
         print $movie[$i][1] . "<p>";
     }// end sample
   echo "Url could not be opened";

Comment and Contribute

Your comment has been submitted and is pending approval.

Sam McKone



(Maximum characters: 1200). You have characters left.