diff options
Diffstat (limited to 'lib/WWW/FairViewer/VideoCategories.pm')
-rw-r--r-- | lib/WWW/FairViewer/VideoCategories.pm | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/lib/WWW/FairViewer/VideoCategories.pm b/lib/WWW/FairViewer/VideoCategories.pm index 85045fd..4dfc125 100644 --- a/lib/WWW/FairViewer/VideoCategories.pm +++ b/lib/WWW/FairViewer/VideoCategories.pm @@ -18,16 +18,6 @@ WWW::FairViewer::VideoCategories - videoCategory resource handler. =cut -sub _make_videoCategories_url { - my ($self, %opts) = @_; - - $self->_make_feed_url( - 'videoCategories', - hl => $self->get_hl, - %opts, - ); -} - =head2 video_categories() Return video categories for a specific region ID. @@ -37,37 +27,13 @@ Return video categories for a specific region ID. sub video_categories { my ($self) = @_; - require File::Spec; - - my $region = $self->get_region() // 'US'; - my $url = $self->_make_videoCategories_url(region => $region); - my $file = File::Spec->catfile($self->get_config_dir, "categories-$region-" . $self->get_hl() . ".json"); - - my $json; - if (open(my $fh, '<:utf8', $file)) { - local $/; - $json = <$fh>; - close $fh; - } - else { - $json = $self->lwp_get($url, simple => 1); - open my $fh, '>:utf8', $file; - print {$fh} $json; - close $fh; - } - - return $self->parse_json_string($json); -} - -=head2 video_category_id_info($cagegory_id) - -Return info for the comma-separated specified category ID(s). - -=cut - -sub video_category_id_info { - my ($self, $id) = @_; - return $self->_get_results($self->_make_videoCategories_url(id => $id)); + return [{id => "music", title => "Music"}, + {id => "gaming", title => "Gaming"}, + {id => "news", title => "News"}, + {id => "movies", title => "Movies"}, + {id => "trending", title => "Trending"}, + {id => "popular", title => "Popular"}, + ]; } =head1 AUTHOR |