|
NAMEWWW::TV::Series - Parse TV.com for TV Series information. SYNOPSISuse WWW::TV::Series qw(); my $series = WWW::TV::Series->new(name => 'Prison Break'); my @episodes = $series->episodes; print $series->summary; DESCRIPTIONThe WWW::TV::Series module parses TV.com series information using LWP::UserAgent. METHODSnew The new() method is the constructor. It takes the id of the show if
you have previously looked that up, or the name of the show which
will be used to perform a search and the id will be taken from the
first result.
Optional parameters let you set the season number or LWP user agent.
# default usage
my $series = WWW::TV::Series->new(name => 'Prison Break');
my $series = WWW::TV::Series->new(id => 31635);
# change user-agent from the default of "libwww-perl/#.##"
my $series = WWW::TV::Series->new(id => 31635, agent => 'WWW::TV');
It is recommended that you lookup the show first and use the ID,
otherwise you just don't know what will be returned.
The constructor also takes a single scalar as an argument and does
it's best to figure out what you want. But due to some shows being
all digits as a name (e.g. "24"), use of this is not recommended
(and in future may be deprecated).
summaryReturns a string containing basic information about this series. genres Returns a list of all the genres that TV.com have categorised this series as.
# in scalar context, returns a comma-delimited string
my $genres = $series->genres;
# in array context, returns an array
my @genres = $series->genres;
cast Returns a list of the cast members. The order is the same as they
appear on TV.com, which is most likely nothing to go by, but
in most cases is the main cast order.
# in scalar context, returns a comma-delimited string
my $cast = $series->cast;
# in array context, returns an array
my @cast = $series->cast;
nameReturns a string containing the name of the series. imageReturns the url of an image that can be used to identify this series. episodes Returns an array of L<WWW::TV::Episode> objects in order.
# All episodes
my @episodes = $series->episodes;
# Episodes for season 2 only
my @episodes = $series->episodes( season => 2 );
idThe ID of this series, according to TV.com agent ($value)Returns the current user agent setting, and sets to $value if provided. site ($value)Returns the current mirror site setting, and sets to $value if provided. Default site is "www"; other options include: us, uk, au urlReturns the url that was used to create this object. episode_url ($season) Returns the url that is used to get the episode listings for this
series.
$season is optional ; defaults to "all"
SEE ALSOWWW::TV::Episode KNOWN ISSUESThere isn't yet any caching support. I don't see a need for it, but if you feel the need to implement it then don't let me stop you. There also isn't support for proxy servers yet. LWP should use it from your environment if you really need it, but who still uses them anyway? Isn't it all done transparently these days. BUGSPlease report any bugs or feature requests through the web interface at <http://rt.cpan.org/Dist/Display.html?Queue=WWW-TV>. AUTHORSDanial Pearce "cpan@tigris.id.au" Stephen Steneker "stennie@cpan.org" LICENCE AND COPYRIGHTCopyright (c) 2006-2008 Danial Pearce "cpan@tigris.id.au". All rights reserved. Some parts copyright 2007-2008 Stephen Steneker "stennie@cpan.org".
|