|
NAMEWWW::TV::Episode - Parse TV.com for TV Episode information.SYNOPSISuse WWW::TV::Episode qw(); my $episode = WWW::TV::Series->new(id => '475567'); # with optional paramers print $episode->summary; DESCRIPTIONThe WWW::TV::Episode module parses TV.com episode information using LWP::UserAgent. Unfortunately I can't see a way to search for an episode by name, so I haven't implemented it. It is probably possible to do so if you populate a series object and grep $series->episodes for the episode name you are searching for.METHODSnewThe new() method is the constructor. It takes the id of the show assuming you have previously looked that up. # default usage my $episode = WWW::TV::Episode->new(id => 924072); # change user-agent from the default of "libwww-perl/#.##" my $episode = WWW::TV::Episode->new(id => 924072, agent => 'WWW::TV'); It also (optionally) takes the name of the episode. This is not used in any way to search for the episode, but is used as initial data population for that field so that the html isn't parsed if you only want an object with the name. This is used by the L<WWW::TV::Series> object to populate a big array of episodes that have names without needing to fetch any pages. # pre-populate episode name my $episode = WWW::TV::Episode->new(id => 924072, name => 'Run!'); idThe ID of this episode, according to TV.com nameReturns a string containing the name of the episode. summaryReturns a string containing basic information about this series. season_numberReturns the season number that this episode appeared in. episode_numberReturns the overall number of this episode. Note, this is not necessarily the production order of the episodes, but is the order in which they aired. format_details ($format_str)Returns episode details using a special format string, similar to printf: %I - series ID %N - series name %s - season number %S - season number (0-padded to two digits, if required) %i - episode ID %e - episode number %E - episode number (0-padded to two digits, if required) %n - episode name %d - date episode first aired The default format is: %N.s%Se%E - %n (eg: "Heroes.s1e02 - Don't Look Back") first_airedReturns a string of the date this episode first aired in ISO 8601 (yyyy-mm-dd) format. starsReturns a list of the stars that appeared in this episode. # in scalar context, returns a comma-delimited string my $stars = $episode->stars; # in array context, returns an array my @stars = $episode->stars; guest_starsReturns a list of the guest stars that appeared in this episode. # in scalar context, returns a comma-delimited string my $guest_stars = $episode->guest_stars; # in array context, returns an array my @guest_stars = $episode->guest_stars; recurring_rolesReturns a list of the people who have recurring roles that appeared in this episode # in scalar context, returns a comma-delimited string my $recurring_roless = $episode->recurring_roless; # in array context, returns an array my @recurring_roless = $episode->recurring_roless; writersReturns a list of the people that wrote this episode. # in scalar context, returns a comma-delimited string my $writers = $episode->writers; # in array context, returns an array my @writers = $episode->writers; directorsReturns a list of the people that directed this episode. # in scalar context, returns a comma-delimited string my $directors = $episode->directors; # in array context, returns an array my @directors = $episode->directors; 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. seasonReturns an array of other episodes for the same season of this series. series_idReturns the series ID for this episode. seriesReturns an L<WWW::TV::Series> object which is the complete series that this episode is a part of. SEE ALSOWWW::TV::SeriesKNOWN 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". This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |