WebService::GData::Feed::Category - Represent an xml category tag.
use WebService::GData::Feed; my $feed = new WebService::GData::Feed($jsonfeed); my $categories= $feed->category(); foreach my $category (@$categories){ #print $category->scheme,$category->term,$category->label; }
inherits from WebService::GData::Feed
This package wraps the category data found in a feed using the json format of the Google Data API v2 (no other format is supported!).
Accept the content of the category tag from a feed that has been perlified (from_json($json_string)).
Parameters
category_info:HashRef
Returns
WebService::GData::Feed::Category
Throws
WebService::GData::Error
Example:
use WebService::GData::Feed::Category; my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]); #or my $category = new WebService::GData::Feed::Category({ scheme => 'http://gdata.youtube.com/schemas/2007/categories.cat', term => 'Shows', label => 'Shows', }); $category->term();#Shows
get/set the scheme of the category.
none
scheme:Scalar
use WebService::GData::Feed::Category; my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]); $category->scheme("http://schemas.google.com/g/2005#kind"); $category->scheme();#http://schemas.google.com/g/2005#kind
get/set the term of the category.
term:Scalar
use WebService::GData::Feed::Category; my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]); $category->term("http://gdata.youtube.com/schemas/2007#video"); $category->term();#http://gdata.youtube.com/schemas/2007#video
get/set the label of the category.
label:Scalar
use WebService::GData::Feed::Category; my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]); $category->label("comedy"); $category->label();#comedy
If you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!
shiriru <shirirulestheworld[arobas]gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::GData, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::GData
CPAN shell
perl -MCPAN -e shell install WebService::GData
For more information on module installation, please visit the detailed CPAN module installation guide.