aboutsummaryrefslogtreecommitdiffstats
path: root/lib/WWW/StrawViewer/GuideCategories.pm
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-02-15 00:05:24 +0200
committertrizen <trizen@protonmail.com>2020-02-15 00:05:24 +0200
commit8e4ba906343718a4a1c2fbd939a9dbe0a75287f8 (patch)
tree340f4a502ddefbdfc0a5eec997751b5e19206aa8 /lib/WWW/StrawViewer/GuideCategories.pm
parent3e92a9d96d2ff6d2718a5a1e0d69dac766f6a141 (diff)
downloadfair-viewer-8e4ba906343718a4a1c2fbd939a9dbe0a75287f8.tar.lz
fair-viewer-8e4ba906343718a4a1c2fbd939a9dbe0a75287f8.tar.xz
fair-viewer-8e4ba906343718a4a1c2fbd939a9dbe0a75287f8.zip
Import files.
Diffstat (limited to 'lib/WWW/StrawViewer/GuideCategories.pm')
-rw-r--r--lib/WWW/StrawViewer/GuideCategories.pm85
1 files changed, 85 insertions, 0 deletions
diff --git a/lib/WWW/StrawViewer/GuideCategories.pm b/lib/WWW/StrawViewer/GuideCategories.pm
new file mode 100644
index 0000000..1f164b1
--- /dev/null
+++ b/lib/WWW/StrawViewer/GuideCategories.pm
@@ -0,0 +1,85 @@
+package WWW::StrawViewer::GuideCategories;
+
+use utf8;
+use 5.014;
+use warnings;
+
+=head1 NAME
+
+WWW::StrawViewer::GuideCategories - Categories interface.
+
+=head1 SYNOPSIS
+
+ use WWW::StrawViewer;
+ my $obj = WWW::StrawViewer->new(%opts);
+ my $videos = $obj->youtube_categories('US');
+
+=head1 SUBROUTINES/METHODS
+
+=cut
+
+sub _make_guideCategories_url {
+ my ($self, %opts) = @_;
+
+ if (not exists $opts{id}) {
+ $opts{regionCode} //= $self->get_regionCode;
+ }
+
+ $self->_make_feed_url('guideCategories', hl => $self->get_hl, %opts);
+}
+
+=head2 guide_categories(;$region_id)
+
+Return guide categories for a specific region ID.
+
+=head2 guide_categories_info($category_id)
+
+Return info for a list of comma-separated category IDs.
+
+=cut
+
+{
+ no strict 'refs';
+
+ foreach my $method (
+ {
+ key => 'id',
+ name => 'guide_categories_info',
+ },
+ {
+ key => 'regionCode',
+ name => 'guide_categories',
+ },
+ ) {
+ *{__PACKAGE__ . '::' . $method->{name}} = sub {
+ my ($self, $id) = @_;
+ return $self->_get_results($self->_make_guideCategories_url($method->{key} => $id // return));
+ };
+ }
+}
+
+=head1 AUTHOR
+
+Trizen, C<< <echo dHJpemVuQHByb3Rvbm1haWwuY29tCg== | base64 -d> >>
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc WWW::StrawViewer::GuideCategories
+
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2013-2015 Trizen.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
+
+See L<http://dev.perl.org/licenses/> for more information.
+
+=cut
+
+1; # End of WWW::StrawViewer::GuideCategories