- SEE ALSO
- KNOWN ISSUES
- LICENCE AND COPYRIGHT
WWW::TV::Series - Parse TV.com for TV Series information.
use WWW::TV::Series qw(); my $series = WWW::TV::Series->new(name => 'Prison Break'); my @episodes = $series->episodes; print $series->summary;
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).
Returns a string containing basic information about this series.
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;
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;
Returns a string containing the name of the series.
Returns the url of an image that can be used to identify this series.
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 );
The ID of this series, according to TV.com
Returns the current user agent setting, and sets to $value if provided.
Returns the current mirror site setting, and sets to $value if provided.
Default site is "www"; other options include: us, uk, au
Returns the url that was used to create this object.
Returns the url that is used to get the episode listings for this series. $season is optional ; defaults to "all"
There 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.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Dist/Display.html?Queue=WWW-TV.
Copyright (c) 2006-2008 Danial Pearce
email@example.com. All rights reserved.
Some parts copyright 2007-2008 Stephen Steneker