This repository has been archived by the owner on Jan 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathimdb_config.php
92 lines (85 loc) · 3.46 KB
/
imdb_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
#############################################################################
# IMDBPHP (c) Giorgos Giagas & Itzchak Rehberg #
# written by Giorgos Giagas #
# extended & maintained by Itzchak Rehberg <[email protected]> #
# http://www.qumran.org/homes/izzy/ #
# ------------------------------------------------------------------------- #
# This program is free software; you can redistribute and/or modify it #
# under the terms of the GNU General Public License (see doc/LICENSE) #
#############################################################################
/* $Id: imdb_config.php,v 1.3 2007/02/26 22:44:14 izzy Exp $ */
// the proxy to use for connections to imdb.
// leave it empty for no proxy.
// this is only supported with PEAR.
define ('PROXY', "");
define ('PROXY_PORT', "");
/** Configuration part of the IMDB classes
* @package Api
* @class imdb_config
*/
class imdb_config {
var $imdbsite;
var $cachedir;
var $usecache;
var $storecache;
var $cache_expire;
var $photodir;
var $photoroot;
var $timeout;
var $imageext;
/** Constructor and only method of this base class.
* There's no need to call this yourself - you should just place your
* configuration data here.
* @constructor imdb_config
*/
function imdb_config(){
// protocol prefix
$this->protocol_prefix = "http://";
// 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->imdbsite = "www.imdb.com";
// cachedir should be writable by the webserver. This doesn't need to be
// under documentroot.
$this->cachedir = './imdb/cache';
//whether to use a cached page to retrieve the information if available.
$this->usecache = true;
//whether to store the pages retrieved for later use.
$this->storecache = true;
// automatically delete cached files older than X secs
$this->cache_expire = 365*24*60*60;
// the extension of cached images
$this->imageext = '.jpg';
// images are stored here after calling photo_localurl()
// this needs to be under documentroot to be able to display them on your pages.
$this->photodir = './imdb/images/';
// this is the URL to the images, i.e. start at your servers DOCUMENT_ROOT
// when specifying absolute path
$this->photoroot = './imdb/images/';
// TWEAKING OPTIONS:
// limit the result set to X movies (0 to disable, comment out to use default of 20)
$this->maxresults = 5000;
// timeout for retriving info, uint in second
$this->timeout = 120;
// out dated time for retrived info, (7 days for default)
$this->outdate_time = 60*60*24*7;
// search variants. Valid options are "sevec" and "moonface". Comment out
// (or set to empty string) to use the default
$this->searchvariant = "";
}
}
require_once ("HTTP/Request2.php");
class IMDB_Request extends HTTP_Request2
{
function IMDB_Request($url){
parent::__construct($url);
if ( PROXY != ""){
$this->setConfig(array('proxy_host' => PROXY, 'proxy_port' => PROXY_PORT));
}
$this->setConfig('follow_redirects', false);
$this->setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
}
}
?>