Changes between Version 11 and Version 12 of MovieDetails
- Timestamp:
- 04/26/10 20:46:29 (5 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MovieDetails
v11 v12 19 19 #!php 20 20 <?php 21 require_once("imdb.class.php"); // include the class file 21 require_once("imdb.class.php"); // include the class file. For Moviepilot: pilot.class.php 22 22 $movie = new imdb($mid); // create an instance of the class and pass it the IMDB ID 23 // For Moviepilot: new pilot($mid) 23 24 $title = $movie->title(); // retrieve the movie title 24 25 $year = $movie->year(); // obtain the year of production … … 39 40 40 41 ||= Step =||= Process =|| 41 ||require_once("imdb.class.php");||The class file will be included into your current script. This implicitly includes all classes it depends upon, such as the ` imdb_base.class.php`.||42 ||require_once("imdb.class.php");||The class file will be included into your current script. This implicitly includes all classes it depends upon, such as the `mdb_base.class.php`.|| 42 43 ||new imdb($mid);||This will create a new instance of the imdb class, and set the IMDB ID for the movie to process at the same time.|| 43 44 ||$movie->title();||The movies title page will be accessed. Since it was not retrieved before, this will result in requesting the page from the configured IMDB site. If caching is enabled, the page will be stored in the cache. The page will for sure be held in a class variable. This variables content will be parsed for the movie title, which is then also kept in another variable - and returned to the calling process.|| … … 48 49 ||$movie->trailers();||This will access a new page, and thus be processed as `$movie->title()` above.|| 49 50 50 This example shows that we try to access the IMDB siteas little as possible.51 This example shows that we try to access external pages as little as possible. 51 52 Processing the same page with the same IMDB ID again would access the pages from 52 53 the cache (if enabled) instead of retrieving them again from the IMDB site.
