.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::FeedPP::MediaRSS 3pm" .TH XML::FeedPP::MediaRSS 3pm "2021-01-08" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::FeedPP::MediaRSS \- MediaRSS support for XML::FeedPP .SH "VERSION" .IX Header "VERSION" version 0.02 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use XML::FeedPP; \& \& my $feed = XML::FeedPP\->new(\*(Aqhttp://a.media.rss/source\*(Aq); \& my $media = XML::FeedPP::MediaRSS\->new($feed); \& for my $i ( $feed\->get_item ) { \& for my $content ( $media\->for_item($i) ) { \& die "18 or over" if $content\->{adult}; \& } \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" XML::FeedPP does not support Yahoo's MediaRSS extension, and it shouldn't. It's only supported in some formats, and XML::FeedPP is a lowest-common-denominator kind of module. That said, sometimes you need to consume feeds with MediaRSS in them. .SH "METHODS" .IX Header "METHODS" .SS "new ( feed )" .IX Subsection "new ( feed )" You have to pass in an XML::FeedPP object. \f(CW\*(C`XML::FeedPP::MediaRSS\*(C'\fR isn't a subclass of XML::FeedPP \- it has one, and inspects its dirty innards (which is somewhat safe since they're produced by XML::TreePP) to find media content. .SS "for_item ( item )" .IX Subsection "for_item ( item )" Pass in a feed item (the things returned by \f(CW\*(C`$feed\->get_item\*(C'\fR) and get back a list of \*(L"XML::FeedPP::MediaRSS::Content\*(R" objects. .SH "KEYS" .IX Header "KEYS" .SS "adult" .IX Subsection "adult" 1 or '' .SS "rating" .IX Subsection "rating" A hash of all the ratings found, schema => rating. .SS "title" .IX Subsection "title" A hash of all titles found, type => value. .SS "keywords" .IX Subsection "keywords" An arrayref of all the keywords found. The comma-delimiting is undone and duplicates are removed. .SS "thumbnails" .IX Subsection "thumbnails" All thumnails found, from most specific (deepest) to least specific. This means that if the channel has a thumbnail and the item has a thumbnail, you'll get the item first, then the channel. If there are multiple thumbnails at the same level, you'll get them in document order. Time coding is not considered. They look like this: .PP .Vb 1 \& { url => \*(Aq...\*(Aq, width => 400, height => 300, time => \*(Aqtimecode\*(Aq } .Ve .SS "category" .IX Subsection "category" Hash of scheme => plain contents of tag .SS "hash" .IX Subsection "hash" Deepest only. .PP .Vb 4 \& { \& algorithm => \*(Aqmd5\*(Aq, \& checksum => \*(Aqdfdec888b72151965a34b4b59031290a\*(Aq, \& } .Ve .SS "player" .IX Subsection "player" Deepest only. .PP .Vb 5 \& { \& url => \*(Aq...\*(Aq, \& height => 300, \& width => 400 \& } .Ve .SS "credit" .IX Subsection "credit" Hash of scheme to role-hash, like this: .PP .Vb 11 \& { \& \*(Aqurn:ebu\*(Aq => { \& actor => [ \& \*(AqJulia Roberts\*(Aq, \& \*(AqTom Hanks\*(Aq, \& ], \& director => [ \& \*(AqStevan Spielberg\*(Aq, \& ] \& } \& } .Ve .SS "copyright" .IX Subsection "copyright" Deepest only. .PP { url => '...', text => '2005 Foobar Media' } .SS "text" .IX Subsection "text" A list of text objects in document order, like this: .PP .Vb 9 \& [ \& { \& type => \*(Aqplain\*(Aq, \& lang => \*(Aqen\*(Aq, \& start => \*(Aqtimecode\*(Aq, \& end => \*(Aqtimecode\*(Aq, \& text => \*(AqThe actual value\*(Aq, \& }, \& ] .Ve .SS "restriction" .IX Subsection "restriction" .Vb 5 \& { \& allow => (1|0), \& type => (country|uri|sharing) \& list => [ ... ] | \*(Aqall\*(Aq | \*(Aqnone\*(Aq \& } .Ve .PP If allow is false, that means deny. .SS "community" .IX Subsection "community" Deepest only. .PP .Vb 10 \& { \& starRating => { \& average => 3.5, \& count => 20, \& min => 1, \& max => 10, \& }, \& statistics => { \& views => 5, \& favorites => 5, \& }, \& tags => { \& news => 5, \& abc => 3, \& reuters => undef, \& }, \& } .Ve .SS "comments" .IX Subsection "comments" Simple list of strings. .SS "embed" .IX Subsection "embed" Hash of key-value pairs. Deepest only. .SS "responses" .IX Subsection "responses" Simple list of strings .SS "backlinks" .IX Subsection "backlinks" Simple list of strings .SS "status" .IX Subsection "status" Deepest only. .PP .Vb 1 \& { state => \*(Aqstatus\*(Aq, reason => \*(Aqreason\*(Aq } .Ve .SS "price" .IX Subsection "price" List of pricing structures, which are hashes with the keys \f(CW\*(C`currency\*(C'\fR (optional), \f(CW\*(C`info\*(C'\fR (optional), \f(CW\*(C`type\*(C'\fR (optional), and \f(CW\*(C`price\*(C'\fR (optional). If none of these is present for a given price tag, we're going to pretend it doesn't exist. .SS "license" .IX Subsection "license" Hash of type, href, and name. Deepest only. .SS "subTitle" .IX Subsection "subTitle" Only one per language as per the spec. .PP .Vb 6 \& { \& \*(Aqen_us\*(Aq => { \& href => \*(Aqhttp://www.example.org/subtitle.smil\*(Aq, \& type => \*(Aqapplication/smil\*(Aq, \& } \& } .Ve .SS "peerLink" .IX Subsection "peerLink" Deepest only, hash of type and href. .SS "location" .IX Subsection "location" \&\fB\s-1NOT SUPPORTED\s0\fR, mostly cause I don't need it and I don't feel like reading the geoRSS spec right now. Patches welcome! .SS "rights" .IX Subsection "rights" value of the status attribute for the deepest rights element. .SS "scenes" .IX Subsection "scenes" Deepest only, list of hashes with keys title, description, start_time, and end_time. .SH "ALPHA" .IX Header "ALPHA" This software hasn't yet been tested beyond the examples provided in the mRSS spec. Failing tests (even better, with patches that fix the failures) are very welcome! Fork and send a pull request on \*(L"\s-1GITHUB\*(R"\s0. .SH "XML::FeedPP::MediaRSS::Content" .IX Header "XML::FeedPP::MediaRSS::Content" These are blessed hashes, but you're allowed to look inside them. In fact, you're really supposed to. It's okay, don't be nervous. .PP The mapping from the MediaRSS spec () to this hash is really straightforward. See the \*(L"\s-1KEYS\*(R"\s0 section for more detail. The shallowness-rules talked about in the spec are applied, e.g. specifiers at higher levels are applied to lower level objects unless they have a more specific rule. .SH "LIMITATIONS" .IX Header "LIMITATIONS" .SS "Groups" .IX Subsection "Groups" You don't have to (get to?) deal with media groups. All the content for an item gets flattened into one list. Future versions of this module may add support for media groups under a different method name (\f(CW\*(C`groups_for_item\*(C'\fR) if anyone ever sends me a patch or I can ever find an actual use for it. .SS "Order" .IX Subsection "Order" The MediaRSS spec says some things about order being dependent on document order. We go by the order we get things from XML::FeedPP's hashes, which will only be the same as document order if you \f(CW\*(C`use_ixhash => 1\*(C'\fR in the feed. And even then, content in media:groups will come before content outside them. .SS "Read-Write" .IX Subsection "Read-Write" This module only supports reading MediaRSS information from a feed, not adding it. I might add this someday, but of course patches are welcome in the meantime. .SH "GITHUB" .IX Header "GITHUB" This project is hosted on github at . .SH "AUTHOR" .IX Header "AUTHOR" Paul Driver .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2011 by Paul Driver . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.