NAME¶
RDF::Redland::RSS - Redland RSS 1.0 Class
SYNOPSIS¶
use RDF::Redland::RSS;
...
my $rss=RDF::Redland::RSS->new_from_model($model);
my $rss2=new RDF::Redland::RSS("http://example.com/test.rdf");
...
for my $channel ($rss->channels) {
...
print "channel title is ",$channel->title->as_string,"\n"; # UTF-8
}
my(@items)=$channel->items;
# Print channel items (URI, title)
for my $item (@items) {
print "item ",$item->uri->as_string, " ", $item->title->as_string, "\n";
}
...
print $rss->as_xhtml(width => 320, align => 'right');
DESCRIPTION¶
A class for processing RSS 1.0 as RDF, traversing the resulting graph using RSS
propertiiies and formatting the output as XHTML.
CONSTRUCTORS¶
- new SOURCE_URI_STRING [BASE_URI_STRING]
- Process RSS 1.0 at source URI SOURCE_URI_STRING. If
the BASE_URI_STRING string is given then use that as the base URI
rather than the source URI.
- new MODEL
- Process RSS 1.0 from content stored in RDF::Redland::Model
MODEL.
METHODS¶
- channels
- Return the RSS channels (<channel> tags) as a list of
RDF::Redland::RSS::Node objects.
- items
- Return the RSS items (<item> tags) as a list of
RDF::Redland::RSS::Node objects.
- image
- Return the RSS 1.0 image (<image> tag) as an
RDF::Redland::RSS::Node object.
- textinput
- Return the RSS 1.0 textinput (<textinput> tag) as an
RDF::Redland::RSS::Node object.
- as_xhtml (key1 => value1, key2 => value2, ...)
- Return a formatted XHTML string (or full XHTML document)
representing the RSS 1.0 content with various options set as listed in the
section below.
The parameters to this method are mostly from the specification of the
viewRssBox macro at http://macros.userland.com/viewRssBox
AS_XHTML OPTIONS¶
- boxTitle
- A string, is the text displayed in the title of the box. It
defaults to the title element of the channel.
- align
- A string, has three possible values, left, right or the
empty string. The HTML table is either left-aligned, right-aligned or not
aligned. It defaults to the empty string.
- width
- A number, is the width of the box, in pixels. It defaults
to 125. Note that the title bar determines the minimum width of the box,
if you're having trouble getting it to be narrower, try shortening
boxTitle.
- frameColor
- A string, is the hex browser color for the frame of the
box. Defaults to "#000000".
- titleBarTextColor
- A string, is the hex browser color for the text in the
title bar of the box. Defalults to "#000000".
- titleBarColor
- A string, is the hex browser color for the title bar of the
box. Defaults to "#ADD8E6".
- boxFillColor
- A string, is the hex browser color for the main part of the
box. Defaults to "#FFFFFF".
- time
- A string, is text that's displayed as the time to the right
of the box title. Defaults to "".
- hspace
- A number, is the number of pixels to the left and right of
the box. Defaults to 0.
- vspace
- A number, is the number of pixels above and below the box.
Defaults to 0.
- full
- If set to any value, returns a full XHTML document.
Defaults to returning an HTML fragment.
- imageAlign
- A string, has two possible values, left or right. The
channel image is either left-aligned or right-aligned. It defaults to
right aligned.
NAME¶
RDF::Redland::RSS::Node - Redland RSS 1.0 Node Class
DESCRIPTION¶
Class representing concepts in an RSS 1.0 RDF graph.
CONSTRUCTORS¶
No public constructors. Nodes are created either by methods of this class or
RDF::Redland::RSS.
METHODS¶
- title
- Get the RSS titles for channel, image, item or textinput.
Returns either a list or first one found depending on calling
context.
- link
- Get the RSS link for channel, image, item or textinput.
Returns either a list or first one found depending on calling
context.
- description
- Get the Dublin Core description element or RSS description
for channel, item or textinput. Returns either a list or first one found
depending on calling context.
- image_url
- Get the RSS image URL string for an image. Returns either a
list or first one found depending on calling context.
- name
- Get the RSS name for a textinput. Returns either a list or
first one found depending on calling context.
- items
- Get the RSS items in a channel as a list of
RDF::Redland::RSS::Node objects.
- image
- Get the image of a channel as an RDF::Redland::RSS::Node
object or undef if not present.
- textinput
- Get the textinput of a channel as an
RDF::Redland::RSS::Node object or undef if not present.
- property PROPERTY
- Get the value of the named property off an
RDF::Redland::RSS::Node where PROPERTY is an RDF::Redland::Node or
RDF::Redland::RSS::Node. Returns a list of RDF::Redland::RSS::Node objects
or first one found depending on calling context.
- properties
- Get all properties off the RDF::Redland::RSS::Node. Returns
a list of RDF::Redland::RSS::Node objects.
- properties_with_ns_prefix NS_PREFIX
- Get all unique properties of the RDF::Redland::RSS::Node
which have namespace URI prefix NS_PREFIX. Returns a list of the
properties as RDF::Redland::RSS::Node objects.
SEE ALSO¶
RDF::Redland::Model and RSS 1.0 web pages at
http://purl.org/rss/1.0/
AUTHOR¶
Dave Beckett -
http://www.dajobe.org/