Overview   Package   Tree   Index 
IMDBPHP
PREV  NEXT Frames  No Frame 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

IMDB
Class imdb

- mdb_config
-

class imdb
extends movie_base

Accessing IMDB information

Authors:
Georgos Giagas, Izzy (izzysoft AT qumran DOT org)
Version:
$Revision: 690 $ $Date: 2014-08-05 09:29:19 +0200 (Di, 05. Aug 2014) $
Copyright:
(c) 2002-2004 by Giorgos Giagas and (c) 2004-2009 by Itzchak Rehberg and IzzySoft

Constructor Summary
void imdb(string $id, [object $mdb_config])
Initialize the class

Method Summary
array alsoknow()
Get movie's alternative names Note: This may return an empty country or comments.
string aspect_ratio()
Aspect Ratio of movie screen
array awards([boolean $compat])
array[festivalName] is array[name,entries] - where name is a string, and entries is above described array. people is an array of imdbid=>name. comment is currently empty, and just kept for backward compatibility, unless you passed FALSE for 'compat' – then comment is omitted, as well as the "intermediate" 'entries' level.
array cast([boolean $clean_ws])
Get the actors
array colors()
Get colors
string comment()
Get movie main comment (from title page)
array comment_split()
Get movie main comment (from title page - split-up variant)
protected void companyParse(string& $text, array& $parse)
Parse company info
array composer()
Obtain the composer(s) ("Original Music by...")
string convertIMDBtoRealURL(string $url)
Convert IMDB redirect-URLs of external sites to real URLs
array country()
Get country of production
array crazy_credits()
Get the Crazy Credits
array creator()
Get the creator of a movie (most likely for seasons only)
array director()
Get the director(s) of the movie
array distCompany()
Info about distributors
string endyear()
Get end-year Usually this returns the same value as year() -- except for those cases where production spanned multiple years, usually for series
array episodes()
Get the series episode(s)
array extReviews()
Get list of external reviews (if any)
mixed fromSearchResult(string $id, string $title, integer $year, string $additional, object $mdb_config)
Create an imdb object populated with id, title, year
string genre()
There is not really a main genre on the IMDB sites (yet), so this simply returns the first one
array genres()
Get all genres the movie is registered for
array get_episode_details()
based on an idea of lennert, see ticket:263
protected string get_imdbname(string $href)
Get the IMDB ID from a names URL
protected array get_row_cels(string $row)
Get content of table row cells
protected mixed get_table_rows(string $html, string $table_start)
Get rows for a given table on the page
protected mixed get_table_rows_cast(string $html, string $table_start)
Get rows for the cast table on the page
array goofs()
Get the goofs
boolean is_serial()
Try to figure out if this is a movie or a serie
array keywords()
Get the keywords for the movie
array keywords_all()
Get the complete keywords for the movie
string language()
There is not really a main language on the IMDB sites (yet), so this simply returns the first one
array languages()
Get all languages this movie is available in
array languages_detailed()
Get all languages this movie is available in, including details
array locations()
Obtain filming locations
string main_url()
Set up the URL to the movie title page
array mainPictures()
Get URLs for the pictures on the main page
array miscsites()
Get the off-site misc URLs
array movie_recommendations()
Get recommended movies (People who liked this.
array movieconnection()
Get connected movie information
string movietype()
This is faster than movietypes() as it is retrieved already together with the title. If no movietype had been defined explicitly, it returns 'Movie' -- so this is always set.
array movieTypes()
Get movie types (if any specified)
array mpaa()
Get the MPAA data (also known as PG or FSK)
array mpaa_hist()
Get the MPAA data (also known as PG or FSK) - including historical data
string mpaa_reason()
Find out the reason for the MPAA rating
array officialSites()
now combined with /videosites to /externalsites
string orig_title()
Get movie original title
array otherCompany()
Info about other companies
array parentalGuide()
Detailed Parental Guide
protected void parse_extcontent(string $title, array $res)
Parse segments of external information on "VideoSites"
protected array parseConnection(string $conn)
Parse connection block (used by method movieconnection only)
mixed photo([boolean $thumb])
Get poster/cover photo
mixed photo_localurl([boolean $thumb])
Get the URL for the movies cover photo
array photosites()
Get the off-site photo URLs
array plot()
Get the movies plot(s)
array plot_split()
Get the movie plot(s) - split-up variant
string plotoutline([boolean $fallback])
Get the main Plot outline for the movie
array prodCompany()
Info about Production Companies
array prodNotes()
For not-yet completed movies, we can get the production state
array producer()
Obtain the producer(s)
array quotes()
Get the quotes for a given movie
protected void rate_vote()
Setup votes
string rating()
Get movie rating
array releaseInfo()
Obtain Release Info (if any)
mixed runtime()
Get overall runtime (first one mentioned on title page)
protected string runtime_all()
Get general runtime
array runtimes()
Retrieve all runtimes and their descriptions
boolean savephoto(string $path, [boolean $thumb])
Save the poster/cover photo to disk
integer seasons()
Get the number of seasons or 0 if not a series
protected string set_pagename(string $wt)
Define page urls
array sound()
Get sound formats
array soundclipsites()
Get the off-site soundclip URLs
array soundtrack()
Get the soundtrack listing
array specialCompany()
Info about Special Effects companies
string storyline()
Get the Storyline for the movie
string synopsis()
Get the movies synopsis
string tagline()
Get the main tagline for the movie
array taglines()
Get all available taglines for the movie
protected boolean thumbphoto()
Setup cover photo (thumbnail and big variant)
string title()
Get movie title
protected void title_year()
Setup title and year properties
integer top250()
Find the position of a movie in the top 250 ranked movies
mixed trailers([boolean $full], [boolean $all])
New code thanks to george (http://projects.izzysoft.de/trac/imdbphp/ticket/286) with some minor adjustments by izzy
array trivia([boolean $spoil])
Get the trivia info
array videosites()
Get the off-site videos and trailer URLs
string votes()
Return votes for this movie
array writing()
Get the writer(s)
string year()
Get year
array yearspan()
Get range of years for e.

Methods inherited from class movie_base and not overridden
reset_vars

Methods inherited from class mdb_base and not overridden
cache_read, cache_write, get_pilot_imdbfill, getWebPage, imdbid, monthNo, openpage, purge, readCachedPage, set_pilot_imdbfill, setid, writeCachedPage

Constructor Detail

imdb()

void imdb(string $id, [object $mdb_config])

Initialize the class

Parameters:
id - IMDBID to use for data retrieval
mdb_config - override default config

Method Detail

alsoknow()

array alsoknow()

Get movie's alternative names Note: This may return an empty country or comments. comment, year and lang are there for backwards compatibility and should not be used

Returns:
aka array[0..n] of array[title,country,comments[]]
See also:
IMDB page ReleaseInfo

aspect_ratio()

string aspect_ratio()

Aspect Ratio of movie screen

Returns:
ratio
See also:
IMDB page / (TitlePage)

awards()

array awards([boolean $compat])

Get the complete awards for the movie

Parameters:
compat - whether stay backward compatible to the original format of Qvist. Default: TRUE
Returns:
awards array[festivalName]['entries'][0..n] of array[year,won,category,award,people[],comment,outcome]
See also:
IMDB page /awards

cast()

array cast([boolean $clean_ws])

Get the actors

Parameters:
clean_ws - whether to clean white-space inside names
Returns:
cast (array[0..n] of arrays[imdb,name,role,thumb,photo])
Version:
the "role" field might contain several "newlines" in the middle of the string. They usually separate multiple entries (see e.g. IMDBID 2186562: "Dakaria Tepes <newlines> (as Laura Roge)"). After this has been brought up with ticket #375, we discussed it on IRC and decided to leave it as-is: If you want it removed, a simple regexp will do that: preg_replace('!\s{2,}!ims',' ',$role). The API shouldn't do this as it would rob those who want to split of the opportunity doing so.
See also:
IMDB page /fullcredits

colors()

array colors()

Get colors

Returns:
colors (array[0..1] of strings)
See also:
IMDB page / (TitlePage)

comment()

string comment()

Get movie main comment (from title page)

Returns:
comment full text of movie comment from the movies main page
See also:
IMDB page / (TitlePage)

comment_split()

array comment_split()

Get movie main comment (from title page - split-up variant)

Returns:
comment array[string title, string date, array author, string comment]; author: array[string url, string name]
See also:
IMDB page / (TitlePage)

companyParse()

protected void companyParse(string& $text, array& $parse)

Parse company info

Parameters:
text - to parse
parse - target

composer()

array composer()

Obtain the composer(s) ("Original Music by...")

Returns:
composer (array[0..n] of arrays[imdb,name,role])
See also:
IMDB page /fullcredits

convertIMDBtoRealURL()

string convertIMDBtoRealURL(string $url)

Convert IMDB redirect-URLs of external sites to real URLs

Parameters:
url - redirect-url
Returns:
url real-url

country()

array country()

Get country of production

Returns:
country (array[0..n] of string)
See also:
IMDB page / (TitlePage)

crazy_credits()

array crazy_credits()

Get the Crazy Credits

Returns:
crazy_credits (array[0..n] of string)
See also:
IMDB page /crazycredits

creator()

array creator()

Get the creator of a movie (most likely for seasons only)

Returns:
creator (array[0..n] of array[name,imdb])
See also:
IMDB page / (TitlePage)

director()

array director()

Get the director(s) of the movie

Returns:
director (array[0..n] of arrays[imdb,name,role])
See also:
IMDB page /fullcredits

distCompany()

array distCompany()

Info about distributors

Returns:
[0..n] of array (name,url,notes)
See also:
IMDB page /companycredits

endyear()

string endyear()

Get end-year Usually this returns the same value as year() -- except for those cases where production spanned multiple years, usually for series

Returns:
year
See also:
IMDB page / (TitlePage)

episodes()

array episodes()

Get the series episode(s)

Returns:
episodes (array[0..n] of array[0..m] of array[imdbid,title,airdate,plot,season,episode])
Version:
Attention: Starting with revision 506 (version 2.1.3), the outer array no longer starts at 0 but reflects the real season number!
See also:
IMDB page /episodes

extReviews()

array extReviews()

Get list of external reviews (if any)

Returns:
[0..n] of array [url, desc] (or empty array if no data)
See also:
IMDB page /externalreviews

fromSearchResult()

mixed fromSearchResult(string $id, string $title, integer $year, string $additional, object $mdb_config)

Create an imdb object populated with id, title, year

Parameters:
id - imdb ID
title - film title
year -
additional -
mdb_config - $config
Returns:
imdb

genre()

string genre()

Get the movies main genre Since IMDB.COM does not really now a "Main Genre", this simply means the first mentioned genre will be returned.

Returns:
genre first of the genres listed on the movies main page
See also:
IMDB page / (TitlePage)

genres()

array genres()

Get all genres the movie is registered for

Returns:
genres (array[0..n] of strings)
See also:
IMDB page / (TitlePage)

get_episode_details()

array get_episode_details()

If it is an episode, we may want to now to know where it belongs to

Returns:
[imdbid,seriestitle,series_prodtime,episodetitle,season,episode]
Version:
series_prodtime is no longer available due to IMDB site changes, see ticket:281
See also:
IMDB page / (TitlePage)

get_imdbname()

protected string get_imdbname(string $href)

Get the IMDB ID from a names URL

Parameters:
href - url to the staff members IMDB page
Returns:
IMDBID of the staff member
See also:
used by the methods director, cast, writing, producer, composer

get_row_cels()

protected array get_row_cels(string $row)

Get content of table row cells

Parameters:
row - (as returned by imdb::get_table_rows)
Returns:
cells (array[0..n] of strings)
See also:
used by the methods director, cast, writing, producer, composer

get_table_rows()

protected mixed get_table_rows(string $html, string $table_start)

Get rows for a given table on the page

Parameters:
html -
table_start -
Returns:
rows (FALSE if table not found, array[0..n] of strings otherwise)
See also:
used by the methods director, cast, writing, producer, composer

get_table_rows_cast()

protected mixed get_table_rows_cast(string $html, string $table_start)

Get rows for the cast table on the page

Parameters:
html -
table_start -
Returns:
rows (FALSE if table not found, array[0..n] of strings otherwise)
See also:
used by the method cast

goofs()

array goofs()

Get the goofs

Returns:
goofs (array[0..n] of array[type,content]
Version:
Spoilers are currently skipped (differently formatted)
See also:
IMDB page /goofs

is_serial()

boolean is_serial()

Try to figure out if this is a movie or a serie

Returns:
See also:
IMDB page / (TitlePage)

keywords()

array keywords()

Get the keywords for the movie

Returns:
keywords
See also:
IMDB page / (TitlePage)

keywords_all()

array keywords_all()

Get the complete keywords for the movie

Returns:
keywords
See also:
IMDB page /keywords

language()

string language()

Get movies original language

Returns:
language
See also:
IMDB page / (TitlePage)

languages()

array languages()

Get all languages this movie is available in

Returns:
languages (array[0..n] of strings)
See also:
IMDB page / (TitlePage)

languages_detailed()

array languages_detailed()

Get all languages this movie is available in, including details

Returns:
languages (array[0..n] of array[string name, string code, string comment], code being the ISO-Code)
See also:
IMDB page / (TitlePage)

locations()

array locations()

Obtain filming locations

Returns:
locations array[0..n] of array[name,url] with name being the name of the location, and url a relative URL to list other movies sharing this location
See also:
IMDB page /locations

main_url()

string main_url()

Set up the URL to the movie title page

Returns:
url full URL to the current movies main page

mainPictures()

array mainPictures()

Get URLs for the pictures on the main page

Returns:
[0..n] of [imgsrc, imglink, bigsrc], where
  • imgsrc is the URL of the thumbnail IMG as displayed on main page
  • imglink is the link to the page with the "big image"
  • bigsrc is the URL of the "big size" image itself
Authors:
moonface, izzy

miscsites()

array miscsites()

Get the off-site misc URLs

Returns:
miscsites array[0..n] of array(site,url,type,desc)
See also:
IMDB page /videosites

movie_recommendations()

array movie_recommendations()

Get recommended movies (People who liked this...also liked)

Returns:
recommendations (array[title,imdbid,year])
See also:
IMDB page / (TitlePage)

movieconnection()

array movieconnection()

Get connected movie information

Returns:
connections (versionOf, editedInto, followedBy, spinOff, spinOffFrom, references, referenced, features, featured, spoofs, spoofed - each an array of mid, name, year, comment or an empty array if no connections of that type)
See also:
IMDB page /movieconnection

movietype()

string movietype()

Get movie type

Returns:
movietype (TV Series, Movie, ...)
See also:
IMDB page / (TitlePage)

movieTypes()

array movieTypes()

Get movie types (if any specified)

Returns:
[0..n] of strings (or empty array if no movie types specified)
See also:
IMDB page / (TitlePage)

mpaa()

array mpaa()

Get the MPAA data (also known as PG or FSK)

Returns:
mpaa (array[country]=rating)
See also:
IMDB page / (TitlePage)

mpaa_hist()

array mpaa_hist()

Get the MPAA data (also known as PG or FSK) - including historical data

Returns:
mpaa (array[country][0..n]=rating)
See also:
IMDB page / (TitlePage)

mpaa_reason()

string mpaa_reason()

Find out the reason for the MPAA rating

Returns:
reason why the movie was rated such
See also:
IMDB page / (TitlePage)

officialSites()

array officialSites()

URLs of Official Sites

Returns:
[0..n] of url, name
See also:
IMDB page /officialsites

orig_title()

string orig_title()

Get movie original title

Returns:
title original movie title (name), if available
See also:
IMDB page / (TitlePage)

otherCompany()

array otherCompany()

Info about other companies

Returns:
[0..n] of array (name,url,notes)
See also:
IMDB page /companycredits

parentalGuide()

array parentalGuide()

Detailed Parental Guide

Returns:
of strings; keys: Alcohol, Sex, Violence, Profanity, Frightening - and maybe more; values: arguments for the rating
See also:
IMDB page /parentalguide

parse_extcontent()

protected void parse_extcontent(string $title, array $res)

Parse segments of external information on "VideoSites"

Parameters:
title - segment title
res - resultset (passed by reference)

parseConnection()

protected array parseConnection(string $conn)

Parse connection block (used by method movieconnection only)

Parameters:
conn - connection type
Returns:
[0..n] of array mid,name,year,comment - or empty array if not found

photo()

mixed photo([boolean $thumb])

Get poster/cover photo

Parameters:
thumb - get the thumbnail (100x140, default) or the bigger variant (400x600 - FALSE)
Returns:
photo (string url if found, FALSE otherwise)
See also:
IMDB page / (TitlePage)

photo_localurl()

mixed photo_localurl([boolean $thumb])

Get the URL for the movies cover photo

Parameters:
thumb - get the thumbnail (100x140, default) or the bigger variant (400x600 - FALSE)
Returns:
url (string URL or FALSE if none)
See also:
IMDB page / (TitlePage)

photosites()

array photosites()

Get the off-site photo URLs

Returns:
photosites array[0..n] of array(site,url,type,desc)
See also:
IMDB page /videosites

plot()

array plot()

Get the movies plot(s)

Returns:
plot (array[0..n] of strings)
See also:
IMDB page /plotsummary

plot_split()

array plot_split()

Get the movie plot(s) - split-up variant

Returns:
array[0..n] of array[string plot,array author] - where author consists of string name and string url
See also:
IMDB page /plotsummary

plotoutline()

string plotoutline([boolean $fallback])

Get the main Plot outline for the movie

Parameters:
fallback - Fallback to storyline if we could not catch plotoutline? Default: FALSE
Returns:
plotoutline
See also:
IMDB page / (TitlePage)

prodCompany()

array prodCompany()

Info about Production Companies

Returns:
[0..n] of array (name,url,notes)
See also:
IMDB page /companycredits

prodNotes()

array prodNotes()

For not-yet completed movies, we can get the production state

Returns:
production notes [status,statnote,lastupdate[day,month,mon,year],more,note]
See also:
IMDB page / (TitlePage)

producer()

array producer()

Obtain the producer(s)

Returns:
producer (array[0..n] of arrays[imdb,name,role])
See also:
IMDB page /fullcredits

quotes()

array quotes()

Get the quotes for a given movie

Returns:
quotes (array[0..n] of string)
See also:
IMDB page /quotes

rate_vote()

protected void rate_vote()

Setup votes


rating()

string rating()

Get movie rating

Returns:
rating current rating as given by IMDB site
See also:
IMDB page / (TitlePage)

releaseInfo()

array releaseInfo()

Obtain Release Info (if any)

Returns:
release_info array[0..n] of strings (country,day,month,mon, year,comment) - "month" is the month name, "mon" the number
See also:
IMDB page /releaseinfo

runtime()

mixed runtime()

Get overall runtime (first one mentioned on title page)

Returns:
string runtime in minutes (if set), NULL otherwise
See also:
IMDB page / (TitlePage)

runtime_all()

protected string runtime_all()

Get general runtime

Returns:
runtime complete runtime string, e.g. "150 min / USA:153 min (director's cut)"

runtimes()

array runtimes()

Retrieve all runtimes and their descriptions

Returns:
runtimes (array[0..n] of array[time,annotations]) where annotations is an array of comments meant to describe this cut
See also:
IMDB page / (TitlePage)

savephoto()

boolean savephoto(string $path, [boolean $thumb])

Save the poster/cover photo to disk

Parameters:
path - where to store the file
thumb - get the thumbnail (100x140, default) or the bigger variant (400x600 - FALSE)
Returns:
success
See also:
IMDB page / (TitlePage)

seasons()

integer seasons()

Get the number of seasons or 0 if not a series

Returns:
seasons number of seasons
See also:
IMDB page / (TitlePage)

set_pagename()

protected string set_pagename(string $wt)

Define page urls

Parameters:
wt - internal name of the page
Returns:
urlname page URL

sound()

array sound()

Get sound formats

Returns:
sound (array[0..n] of strings)
See also:
IMDB page / (TitlePage)

soundclipsites()

array soundclipsites()

Get the off-site soundclip URLs

Returns:
soundclipsites array[0..n] of array(site,url,type,desc)
See also:
IMDB page /videosites

soundtrack()

array soundtrack()

Get the soundtrack listing

Returns:
soundtracks (array[0..n] of array(soundtrack,array[0..n] of credits array[credit_to,desc])
See also:
IMDB page /soundtrack

specialCompany()

array specialCompany()

Info about Special Effects companies

Returns:
[0..n] of array (name,url,notes)
See also:
IMDB page /companycredits

storyline()

string storyline()

Get the Storyline for the movie

Returns:
storyline
See also:
IMDB page / (TitlePage)

synopsis()

string synopsis()

Get the movies synopsis

Returns:
synopsis
See also:
IMDB page /synopsis

tagline()

string tagline()

Get the main tagline for the movie

Returns:
tagline
See also:
IMDB page / (TitlePage)

taglines()

array taglines()

Get all available taglines for the movie

Returns:
taglines (array[0..n] of strings)
See also:
IMDB page /taglines

thumbphoto()

protected boolean thumbphoto()

Setup cover photo (thumbnail and big variant)

Returns:
success (TRUE if found, FALSE otherwise)
See also:
IMDB page / (TitlePage)

title()

string title()

Get movie title

Returns:
title movie title (name)
See also:
IMDB page / (TitlePage)

title_year()

protected void title_year()

Setup title and year properties


top250()

integer top250()

Find the position of a movie in the top 250 ranked movies

Returns:
position a number between 1..250 if the movie is listed, 0 otherwise
Authors:
abe
See also:
http://projects.izzysoft.de/trac/imdbphp/ticket/117

trailers()

mixed trailers([boolean $full], [boolean $all])

Get the trailer URLs for a given movie

Parameters:
full - Retrieve all available data (TRUE), or stay compatible with previous IMDBPHP versions (FALSE, Default)
all - Fetch all trailers (including off-site ones)? Default: True
Returns:
trailers either array[0..n] of string ($full=FALSE), or array[0..n] of array[lang,title,url,restful_url,resolution] ($full=TRUE)
Authors:
george, izzy
See also:
IMDB page /trailers

trivia()

array trivia([boolean $spoil])

Get the trivia info

Parameters:
spoil - Whether to retrieve the spoilers (TRUE) or the non-spoilers (FALSE, default)
Returns:
trivia (array[0..n] string
See also:
IMDB page /trivia

videosites()

array videosites()

Get the off-site videos and trailer URLs

Returns:
videosites array[0..n] of array(site,url,type,desc)
See also:
IMDB page /videosites

votes()

string votes()

Return votes for this movie

Returns:
votes count of votes for this movie
See also:
IMDB page / (TitlePage)

writing()

array writing()

Get the writer(s)

Returns:
writers (array[0..n] of arrays[imdb,name,role])
See also:
IMDB page /fullcredits

year()

string year()

Get year

Returns:
year
See also:
IMDB page / (TitlePage)

yearspan()

array yearspan()

Get range of years for e.g. series spanning multiple years

Returns:
yearspan [start,end] (if there was no range, start==end)
See also:
IMDB page / (TitlePage)

 Overview   Package   Tree   Index 
IMDBPHP
PREV  NEXT Frames  No Frame 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug

This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stephane GALLAND (under the GNU General Public License)