NAME
rss -
Procedures to handle RSS
SYNOPSIS
package require rss
rss::parse rss
rss::parsefile rssfile
channel title ?value?
channel link ?value?
channel description ?value?
channel language ?value?
channel items
channel image
channel textinput
channel serialize format
item title ?value?
item link ?value?
item description ?value?
image title ?value?
image url ?value?
image link ?value?
textinput title ?value?
textinput description ?value?
textinput name ?value?
textinput link ?value?
DESCRIPTION
This package makes it easy to parse, create and update RSS files.
Follwing formats are supported.
- RSS (Rich Site Summary) 0.91
- RSS (RDF Site Summary) 1.0
- rss::parse rss
-
Parse RSS.
The return result is the token of the channel.
- rss::parsefile rssfile
-
Parse an RSS file specified by rssfile.
The return result is the token of the channel.
CHANNEL OBJECT
- channel title ?value?
-
Return the title of channel.
If value is specified, then set the title to value and return its value.
- channel link ?value?
-
Return the URL of channel.
If value is specified, then set the URL to value and return its value.
- channel description ?value?
-
Return the description of channel.
If value is specified, then set the description to value and return its value.
- channel language ?value?
-
Return the language of channel.
If value is specified, then set the language to value and return its value.
- channel items
-
Return a list of the tokens of the items in channel.
- channel image
-
Return the token of the image asociated with channel.
- channel textinput
-
Return the token of the textinput asociated with channel.
- channel serialize format
-
Returns XML-formatted string.
format can be either rss0.91 or rss1.0.
The latter is not implemented yet.
ITEM OBJECT
- item title ?value?
-
Return the title of item.
If value is specified, then set the title to value and return its value.
- item link ?value?
-
Return the URL of item.
If value is specified, then set the URL to value and return its value.
- item description ?value?
-
Return the description of item.
If value is specified, then set the description to value and return its value.
IMAGE OBJECT
- image title ?value?
-
Return the title of image.
If value is specified, then set the title to value and return its value.
- image url ?value?
-
Return the URL of image itself.
If value is specified, then set the URL to value and return its value.
- image link ?value?
-
Return the URL to which image should be linked.
If value is specified, then set the URL to value and return its value.
TEXTINPUT OBJECT
- textinput title ?value?
-
Return the label for the button of textinput.
If value is specified, then set the label to value and return its value.
- textinput description ?value?
-
Return the description of textinput.
If value is specified, then set the description to value and return its value.
- textinput name ?value?
-
Return the name of the text that is passed to textinput.
If value is specified, then set the name to value and return its value.
- textinput link ?value?
-
Return the URL of textinput.
If value is specified, then set the URL to value and return its value.
EXAMPLE
package require rss
set f [open rss.xml]
fconfigure $f -encoding utf-8
set rawrss [read $f]
close $f
set channel [rss::parse $rawrss]
puts "Feed:[$channel title]"
foreach item [$channel items] {
puts [$item title]
}