1RDF::Redland::RSS(3) User Contributed Perl Documentation RDF::Redland::RSS(3)
2
3
4
6 RDF::Redland::RSS - Redland RSS 1.0 Class
7
9 use RDF::Redland::RSS;
10
11 ...
12 my $rss=RDF::Redland::RSS->new_from_model($model);
13
14 my $rss2=new RDF::Redland::RSS("http://example.com/test.rdf");
15 ...
16
17 for my $channel ($rss->channels) {
18 ...
19 print "channel title is ",$channel->title->as_string,"\n"; # UTF-8
20 }
21
22 my(@items)=$channel->items;
23 # Print channel items (URI, title)
24 for my $item (@items) {
25 print "item ",$item->uri->as_string, " ", $item->title->as_string, "\n";
26 }
27
28 ...
29
30 print $rss->as_xhtml(width => 320, align => 'right');
31
33 A class for processing RSS 1.0 as RDF, traversing the resulting graph
34 using RSS propertiiies and formatting the output as XHTML.
35
37 new SOURCE_URI_STRING [BASE_URI_STRING]
38 Process RSS 1.0 at source URI SOURCE_URI_STRING. If the
39 BASE_URI_STRING string is given then use that as the base URI
40 rather than the source URI.
41
42 new MODEL
43 Process RSS 1.0 from content stored in RDF::Redland::Model MODEL.
44
46 channels
47 Return the RSS channels (<channel> tags) as a list of
48 RDF::Redland::RSS::Node objects.
49
50 items
51 Return the RSS items (<item> tags) as a list of
52 RDF::Redland::RSS::Node objects.
53
54 image
55 Return the RSS 1.0 image (<image> tag) as an
56 RDF::Redland::RSS::Node object.
57
58 textinput
59 Return the RSS 1.0 textinput (<textinput> tag) as an
60 RDF::Redland::RSS::Node object.
61
62 as_xhtml (key1 => value1, key2 => value2, ...)
63 Return a formatted XHTML string (or full XHTML document)
64 representing the RSS 1.0 content with various options set as listed
65 in the section below.
66
67 The parameters to this method are mostly from the specification of
68 the viewRssBox macro at http://macros.userland.com/viewRssBox
69
71 boxTitle
72 A string, is the text displayed in the title of the box. It
73 defaults to the title element of the channel.
74
75 align
76 A string, has three possible values, left, right or the empty
77 string. The HTML table is either left-aligned, right-aligned or not
78 aligned. It defaults to the empty string.
79
80 width
81 A number, is the width of the box, in pixels. It defaults to 125.
82 Note that the title bar determines the minimum width of the box, if
83 you're having trouble getting it to be narrower, try shortening
84 boxTitle.
85
86 frameColor
87 A string, is the hex browser color for the frame of the box.
88 Defaults to "#000000".
89
90 titleBarTextColor
91 A string, is the hex browser color for the text in the title bar of
92 the box. Defalults to "#000000".
93
94 titleBarColor
95 A string, is the hex browser color for the title bar of the box.
96 Defaults to "#ADD8E6".
97
98 boxFillColor
99 A string, is the hex browser color for the main part of the box.
100 Defaults to "#FFFFFF".
101
102 time
103 A string, is text that's displayed as the time to the right of the
104 box title. Defaults to "".
105
106 hspace
107 A number, is the number of pixels to the left and right of the box.
108 Defaults to 0.
109
110 vspace
111 A number, is the number of pixels above and below the box. Defaults
112 to 0.
113
114 full
115 If set to any value, returns a full XHTML document. Defaults to
116 returning an HTML fragment.
117
118 imageAlign
119 A string, has two possible values, left or right. The channel image
120 is either left-aligned or right-aligned. It defaults to right
121 aligned.
122
124 RDF::Redland::RSS::Node - Redland RSS 1.0 Node Class
125
127 Class representing concepts in an RSS 1.0 RDF graph.
128
130 No public constructors. Nodes are created either by methods of this
131 class or RDF::Redland::RSS.
132
134 title
135 Get the RSS titles for channel, image, item or textinput. Returns
136 either a list or first one found depending on calling context.
137
138 link
139 Get the RSS link for channel, image, item or textinput. Returns
140 either a list or first one found depending on calling context.
141
142 description
143 Get the Dublin Core description element or RSS description for
144 channel, item or textinput. Returns either a list or first one
145 found depending on calling context.
146
147 image_url
148 Get the RSS image URL string for an image. Returns either a list
149 or first one found depending on calling context.
150
151 name
152 Get the RSS name for a textinput. Returns either a list or first
153 one found depending on calling context.
154
155 items
156 Get the RSS items in a channel as a list of RDF::Redland::RSS::Node
157 objects.
158
159 image
160 Get the image of a channel as an RDF::Redland::RSS::Node object or
161 undef if not present.
162
163 textinput
164 Get the textinput of a channel as an RDF::Redland::RSS::Node object
165 or undef if not present.
166
167 property PROPERTY
168 Get the value of the named property off an RDF::Redland::RSS::Node
169 where PROPERTY is an RDF::Redland::Node or RDF::Redland::RSS::Node.
170 Returns a list of RDF::Redland::RSS::Node objects or first one
171 found depending on calling context.
172
173 properties
174 Get all properties off the RDF::Redland::RSS::Node. Returns a list
175 of RDF::Redland::RSS::Node objects.
176
177 properties_with_ns_prefix NS_PREFIX
178 Get all unique properties of the RDF::Redland::RSS::Node which have
179 namespace URI prefix NS_PREFIX. Returns a list of the properties
180 as RDF::Redland::RSS::Node objects.
181
183 RDF::Redland::Model and RSS 1.0 web pages at http://purl.org/rss/1.0/
184
186 Dave Beckett - http://www.dajobe.org/
187
188
189
190perl v5.30.1 2020-01-30 RDF::Redland::RSS(3)