IMDB::BaseClass(3pm)
π IMDB::BaseClass π
okay bestie, gather round, because this is the perl doc for IMDB::BaseClass β a User Contributed Perl Documentation page, and she's giving foundation. This is the base class that IMDB::Film and IMDB::Persons both build on top of. Periodt.
β¨ NAME β¨
IMDB::BaseClass β a base class for IMDB::Film and IMDB::Persons. literally the blueprint, the blueprint-iest blueprint π«Ά
πΈ SYNOPSIS πΈ
use base qw(IMDB::BaseClass);
that's it. that's the whole vibe check. inherit from her and you're in. π
π¦ DESCRIPTION π¦
IMDB::BaseClass implements a base functionality for IMDB::Film and IMDB::Persons. she's the mom friend holding everything together so the other two can be main characters. β¨
π Constructor and initialization π
new()β the object's constructor, the whole origin story. you should pass as parameter a movie title or an IMDB code.
my $imdb = new IMDB::Film(crit => <some code>);
or
my $imdb = new IMDB::Film(crit => <some title>);
also, you can specify following optional parameters:
- proxy - define proxy server name and port;
- debug - switch on debug mode (on by default);
- cache - cache or not of content retrieved pages.
_init()β initialize object. she gets the list of service class properties and assigns a value to them from the input parameters, or from the hash with default values. lowkey the setup montage scene. π«user_agent()β define a user agent for the HTTP request. it's'Mozilla/5.0'by default. for more information refer toLWP::UserAgent. she's dressing up for the occasion fr fr.timeout()β define a timeout for the HTTP request in seconds. by default it's 10 sec. for more information refer toLWP::UserAgent. nobody got time to wait forever, bestie. β°code()β get the IMDB film code.
my $code = $film->code();
id()β get the IMDB film id (actually, it's the same as code). yeah they're twins. matching outfits. no notes. π―
my $id = $film->id();
_proxy()β store the address of the proxy server. you can pass a proxy name as a parameter into the object constructor:
my $imdb = new IMDB::Film(code => 111111, proxy => 'my.proxy.host:8080');
or you can define the environment variable 'http_host'. for exanple, for Linux you shoud do a following:
export http_proxy=my.proxy.host:8080
ngl bestie, the original page says'http_host'up there and then exportshttp_proxyβ im just the messenger, copying her exactly as she is. π
_cache()β store the cache flag. indicates whether to use file cache to store the content page or not:
my $imdb = new IMDB::Film(code => 111111, cache => 1);
_clear_cacheβ store the flagclear_cache, which indicates whether to clear the existing cache or not (false by default):
my $imdb = new IMDB::Film(code => 111111, cache => 1, clear_cache => 1);
_cacheObj()β in case of using cache, we create a newCache::Fileobject and store it in the object's property. for more details aboutCache::Fileplease seeCache::Cachedocumentation. it's giving β¨ object permanence β¨_cache_exp()β in case of using cache, we can define the value of the cache expire time.
my $imdb = new IMDB::Film(code => 111111, cache_exp => '1 h');
for more details please see Cache::Cache documentation.
_host()β store the IMDB host name. you can pass this value in the object constructor:
my $imdb = new IMDB::Film(code => 111111, host => 'us.imdb.com');
by default, it uses 'www.imdb.com'. home sweet home. π
_query()β store the query string used to retrieve a film by its ID. you can define a different value for that:
my $imdb = new IMDB::Film(code => 111111, query => 'some significant string');
the default value is 'title/tt'.
note: this is a mainly service parameter. so, there is no reason to pass it in the real case. girl is internal, don't bother her. π
_search()β store the search string used to find a film by its title. you can define a different value for that:
my $imdb = new IMDB::Film(code => 111111, seach => 'some significant string');
the default value is 'Find?select=Titles&for='. (and yes bestie, the original spells it seach in that example β we keep her exactly as she is, typos and all π
)
_debug()β indicate whether to use DEBUG mode to display some debug messages:
my $imdb = new IMDB::Film(code => 111111, debug => 1);
by default, debug mode is switched off. so quiet. so mysterious. π€«
_content()β connect to the IMDB, retrieve the page according to crit: by film IMDB ID or by its title, and store the content of that page in the object property. in case of using cache, first check if the page was already stored in the cache, then retrieve the page from the cache, else store the content of the page in the cache. she's the fetch girlie. π₯_parser()β setupHTML::TokeParserand store it. to have the possibility to inherit that class, we should every time initialize the parser using the stored content of the page. for more information please seeHTML::TokeParserdocumentation. fresh parser every single time, no cap. π§_get_simple_prop()β retrieve a simple movie property which is surrownded by<B>. bold and beautiful, literally. βmatched()β retrieve a list of matched films, each element of which is a hash reference β{ id => <Film ID>, title => <Film Title>:
my @matched = @{ $film->matched() };
note: if the movie was matched by title unambiguously it won't be present in this array! so if she's not in the list, she's the one. iconic. π
error()β return a string which contains error messages separated by\n:
my $errors = $film->error();
π EXPORTS π
Nothing
empty handed but in a chic way. we love a minimalist. π
π BUGS π
please, send me any found bugs by email: stepanov.michael@gmail.com.
found a bug? don't be shy, slide into the inbox. π«Ά
π SEE ALSO π
IMDB::Persons IMDB::Film WWW::Yahoo::Movies HTML::TokeParser
the whole friend group, linked up. iykyk. β¨
π AUTHOR π
Mikhail Stepanov AKA nite_man (stepanov.michael@gmail.com)
πΈ COPYRIGHT πΈ
Copyright (c) 2004 - 2007, Mikhail Stepanov. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
and that's the whole page bestie, we ate and left no crumbs π
β¨ this one's from perl v5.32.0, dated 2021-01-07 β stay slaying out there, and remember: IMDB::BaseClass(3pm) loves you. π¦π
π¦ where this page comes from
- debian bookworm: libimdb-film-perl 0.53-1.1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- debian trixie: libimdb-film-perl 0.53-1.1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu jammy: libimdb-film-perl 0.53-1.1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu noble: libimdb-film-perl 0.53-1.1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms