Location: PHPKode > scripts > IMDB Parser > imdb-parser/example-pear_request.php
<?php
/*
* Example using with PEAR Package HTTP_Request
* http://pear.php.net/package/HTTP_Request
*/

//get a video detail site from imdb.com
require_once "HTTP/Request.php";
$req =& new HTTP_Request('http://imdb.com/title/tt0138704/'); // movie PI

if (!PEAR::isError($req->sendRequest())) 
{
    $imdb_website = $req->getResponseBody();
}

//include the parser-class
require("classes/class.imdb_parser.php");

//init the class
$IMDB_Parser = new IMDB_Parser;

// output movie-picture (html)
print "<p>".$IMDB_Parser->getMoviePictureHtml($imdb_website)."</p>";

// output movie-title
print "<br />Title: ".$IMDB_Parser->getMovieTitle($imdb_website);

// output movie-tagline
print "<br />Tagline: ".$IMDB_Parser->getMovieTagline($imdb_website);

// output movie-plot
print "<br />Plot: ".$IMDB_Parser->getMoviePlot($imdb_website);

// output movie-actors (array)
print "<br />Actors: ";
foreach($IMDB_Parser->getMovieActors($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-user rating
print "<br />User Rating: ".$IMDB_Parser->getMovieRating($imdb_website);

// output movie-languages (array)
print "<br />Languages: ";
foreach($IMDB_Parser->getMovieLanguage($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-color
print "<br />Color: ".$IMDB_Parser->getMovieColor($imdb_website);

// output movie-country (array)
print "<br />Country: ";
foreach($IMDB_Parser->getMovieCountry($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-directed by
print "<br />Directed by: ".$IMDB_Parser->getMovieDirectedBy($imdb_website);

// output movie-picture path
print "<br />Picture Path: ".$IMDB_Parser->getMoviePicture($imdb_website);

// output movie-genres (array)
print "<br />Genres: | ";
foreach($IMDB_Parser->getMovieGenres($imdb_website) as $value)
{
    print $value." | ";
}
?>
Return current item: IMDB Parser