imdbsite = "us.imdb.com"; // the imdb server to use. // choices are us.imdb.com uk.imdb.com german.imdb.com // and italian.imdb.com // the localized ones (i.e. italian and german) are // only qualified to find the movies IMDB ID -- but // parsing for the details will fail at the moment. $this->cachedir = '/var/www/web1/web/imdb/cache/'; //cachedir should be writable by the webserver. //this doesn't need to be under documentroot. $this->usecache = true; //whether to use a cached page to retrieve the information if available. $this->storecache = true; //whether to store the pages retrieved for later use. $this->cache_expire = 0; // automatically delete cached files older than X secs $this->photodir = '/var/www/web1/web/imdb/images'; //images are stored here after calling photo_localurl() // this needs to be under documentroot to be able to display them on your pages. $this->photoroot = 'imdb/images/'; } } // Don't edit below this line if you don't know exactly what you're doing :) if ( $PEAR ){ // this release requires the HTTP_Request class from the PEAR project. require_once ("HTTP/Request.php"); class IMDB_Request extends HTTP_Request{ function IMDB_Request($url){ $this->HTTP_Request($url); if ( PROXY != ""){ $this->setProxy(PROXY, PROXY_PORT); } $this->_allowRedirects = false; $this->addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); } } }else{ require_once ("browseremulator.class.php"); class IMDB_Request extends BrowserEmulator{ var $maxsize = 100000; function IMDB_Request($url){ $this->BrowserEmulator(); $this->urltoopen = $url; } function sendRequest(){ $this->fpopened = $this->fopen($this->urltoopen); } function getResponseBody(){ while (!feof ($this->fpopened)) { $page .= fread ($this->fpopened, 1024); } return $page; } function setURL($url){ $this->urltoopen = $url; } function getresponseheader($header = false){ $headers = $this->getLastResponseHeaders(); foreach ($headers as $head){ if ( is_integer(strpos ($head, $header) )){ $hstart = strpos ($head, ": "); $head = trim(substr($head,$hstart+2,100)); return $head; } } } } } ?>