PHP Class IMDB, PHP-IMDB-Grabber

This PHP library enables you to scrap data from IMDB.com. If you want to thank me for this library, please buy me something at Amazon: https://www.amazon.de/gp/registry/wishlist/8840JITISN9L/ - thank you in advance! :)
Author: Fabian Beiner ([email protected])
Mostrar archivo Open project: fabianbeiner/php-imdb-grabber Class Usage Examples

Public Properties

Property Type Description
$bArrayOutput Return responses enclosed in array
$iId The ID of the movie.
$isReady Is the content ready?
$sNotFound The string returned, if nothing is found.
$sSeparator Char that separates multiple entries.
$sUrl The URL to the movie.

Public Methods

Method Description
__construct ( string $sSearch, null $iCache = null, string $sSearchFor = 'all' )
getAka ( ) : string
getAkas ( ) : string Returns all local names
getAll ( ) : array
getAspectRatio ( ) : string
getAwards ( ) : string
getCast ( integer $iLimit, boolean $bMore = true ) : string
getCastAndCharacter ( integer $iLimit, boolean $bMore = true ) : string
getCastAndCharacterAsUrl ( integer $iLimit, boolean $bMore = true, string $sTarget = '' ) : string
getCastAsUrl ( integer $iLimit, boolean $bMore = true, string $sTarget = '' ) : string
getCertification ( ) : string
getColor ( ) : string
getCompany ( ) : string
getCompanyAsUrl ( string $sTarget = '' ) : string
getCountry ( ) : string
getCountryAsUrl ( string $sTarget = '' ) : string
getCreator ( ) : string
getCreatorAsUrl ( string $sTarget = '' ) : string
getDirector ( ) : string
getDirectorAsUrl ( string $sTarget = '' ) : string
getGenre ( ) : string
getGenreAsUrl ( string $sTarget = '' ) : string
getLanguage ( ) : string
getLanguageAsUrl ( string $sTarget = '' ) : string
getLocation ( ) : string
getLocationAsUrl ( string $sTarget = '' ) : string
getMpaa ( ) : string
getPlot ( integer $iLimit ) : string
getPlotKeywords ( ) : string
getPoster ( string $sSize = 'small', boolean $bDownload = false ) : boolean | string
getRating ( ) : string
getReleaseDate ( ) : string
getRuntime ( ) : string
getSeasons ( ) : string
getSeasonsAsUrl ( string $sTarget = '' ) : string
getSoundMix ( ) : string
getTagline ( ) : string
getTitle ( boolean $bForceLocal = false ) : string
getTrailerAsUrl ( boolean $bEmbed = false ) : string
getUrl ( ) : string
getUserReview ( ) : string
getVotes ( ) : string
getWriter ( ) : string
getWriterAsUrl ( string $sTarget = '' ) : string
getYear ( ) : string
isReleased ( ) : true Release date doesn't contain all the information we need to create a media and we need this function that checks if users can vote target media (if can, it's released).

Private Methods

Method Description
fetchUrl ( string $sSearch ) : boolean

Method Details

__construct() public method

public __construct ( string $sSearch, null $iCache = null, string $sSearchFor = 'all' )
$sSearch string IMDb URL or movie title to search for.
$iCache null Custom cache time in minutes.
$sSearchFor string What to search for?

getAka() public method

public getAka ( ) : string
return string “Also Known As” or $sNotFound.

getAkas() public method

Returns all local names
public getAkas ( ) : string
return string The aka name.

getAll() public method

public getAll ( ) : array
return array All data.

getAspectRatio() public method

public getAspectRatio ( ) : string
return string “Aspect Ratio” or $sNotFound.

getAwards() public method

public getAwards ( ) : string
return string The awards of the movie or $sNotFound.

getCast() public method

public getCast ( integer $iLimit, boolean $bMore = true ) : string
$iLimit integer How many cast members should be returned?
$bMore boolean Add … if there are more cast members than printed.
return string A list with cast members or $sNotFound.

getCastAndCharacter() public method

public getCastAndCharacter ( integer $iLimit, boolean $bMore = true ) : string
$iLimit integer How many cast members should be returned?
$bMore boolean Add … if there are more cast members than printed.
return string A list with cast members and their character or $sNotFound.

getCastAndCharacterAsUrl() public method

public getCastAndCharacterAsUrl ( integer $iLimit, boolean $bMore = true, string $sTarget = '' ) : string
$iLimit integer How many cast members should be returned?
$bMore boolean Add … if there are more cast members than printed.
$sTarget string Add a target to the links?
return string A list with linked cast members and their character or $sNotFound.

getCastAsUrl() public method

public getCastAsUrl ( integer $iLimit, boolean $bMore = true, string $sTarget = '' ) : string
$iLimit integer How many cast members should be returned?
$bMore boolean Add … if there are more cast members than printed.
$sTarget string Add a target to the links?
return string A list with linked cast members or $sNotFound.

getCertification() public method

public getCertification ( ) : string
return string The certification of the movie or $sNotFound.

getColor() public method

public getColor ( ) : string
return string Color or $sNotFound.

getCompany() public method

public getCompany ( ) : string
return string The company producing the movie or $sNotFound.

getCompanyAsUrl() public method

public getCompanyAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string The linked company producing the movie or $sNotFound.

getCountry() public method

public getCountry ( ) : string
return string A list with countries or $sNotFound.

getCountryAsUrl() public method

public getCountryAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with linked countries or $sNotFound.

getCreator() public method

public getCreator ( ) : string
return string A list with the creators or $sNotFound.

getCreatorAsUrl() public method

public getCreatorAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked creators or $sNotFound.

getDirector() public method

public getDirector ( ) : string
return string A list with the directors or $sNotFound.

getDirectorAsUrl() public method

public getDirectorAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked directors or $sNotFound.

getGenre() public method

public getGenre ( ) : string
return string A list with the genres or $sNotFound.

getGenreAsUrl() public method

public getGenreAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked genres or $sNotFound.

getLanguage() public method

public getLanguage ( ) : string
return string A list with the languages or $sNotFound.

getLanguageAsUrl() public method

public getLanguageAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked languages or $sNotFound.

getLocation() public method

public getLocation ( ) : string
return string A list with the location or $sNotFound.

getLocationAsUrl() public method

public getLocationAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked location or $sNotFound.

getMpaa() public method

public getMpaa ( ) : string
return string The MPAA of the movie or $sNotFound.

getPlot() public method

public getPlot ( integer $iLimit ) : string
$iLimit integer The limit.
return string The plot of the movie or $sNotFound.

getPlotKeywords() public method

public getPlotKeywords ( ) : string
return string A list with the plot keywords or $sNotFound.

getPoster() public method

public getPoster ( string $sSize = 'small', boolean $bDownload = false ) : boolean | string
$sSize string Small or big poster?
$bDownload boolean Return URL to the poster or download it?
return boolean | string Path to the poster.

getRating() public method

public getRating ( ) : string
return string The rating of the movie or $sNotFound.

getReleaseDate() public method

public getReleaseDate ( ) : string
return string The release date of the movie or $sNotFound.

getRuntime() public method

public getRuntime ( ) : string
return string The runtime of the movie or $sNotFound.

getSeasons() public method

public getSeasons ( ) : string
return string A list with the seasons or $sNotFound.

getSeasonsAsUrl() public method

public getSeasonsAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked seasons or $sNotFound.

getSoundMix() public method

public getSoundMix ( ) : string
return string The sound mix of the movie or $sNotFound.

getTagline() public method

public getTagline ( ) : string
return string The tagline of the movie or $sNotFound.

getTitle() public method

public getTitle ( boolean $bForceLocal = false ) : string
$bForceLocal boolean Try to return the original name of the movie.
return string The title of the movie or $sNotFound.

getTrailerAsUrl() public method

public getTrailerAsUrl ( boolean $bEmbed = false ) : string
$bEmbed boolean Link to player directly?
return string The URL to the trailer of the movie or $sNotFound.

getUrl() public method

public getUrl ( ) : string
return string The IMDb URL.

getUserReview() public method

public getUserReview ( ) : string
return string The user review of the movie or $sNotFound.

getVotes() public method

public getVotes ( ) : string
return string The votes of the movie or $sNotFound.

getWriter() public method

public getWriter ( ) : string
return string A list with the writers or $sNotFound.

getWriterAsUrl() public method

public getWriterAsUrl ( string $sTarget = '' ) : string
$sTarget string Add a target to the links?
return string A list with the linked writers or $sNotFound.

getYear() public method

public getYear ( ) : string
return string The year of the movie or $sNotFound.

isReleased() public method

Release date doesn't contain all the information we need to create a media and we need this function that checks if users can vote target media (if can, it's released).
public isReleased ( ) : true
return true If the media is released

Property Details

$bArrayOutput public_oe property

Return responses enclosed in array
public $bArrayOutput

$iId public_oe property

The ID of the movie.
public $iId

$isReady public_oe property

Is the content ready?
public $isReady

$sNotFound public_oe static_oe property

The string returned, if nothing is found.
public static $sNotFound

$sSeparator public_oe property

Char that separates multiple entries.
public $sSeparator

$sUrl public_oe property

The URL to the movie.
public $sUrl