Typical usage of Orchard.RSS looks like this:
import Orchard.RSS channel = Orchard.RSS.load('http://monkeyfist.com/rss1.php3') dc = "http://purl.org/dc/elements/1.1/" ag = "http://purl.org/rss/1.0/modules/aggregation/" print "Site: " + channel.title print "URL: " + channel.link print "Description: " + channel.description print "Copyright: " + channel[(dc, 'rights')] print "Language: " + channel[(dc, 'language')] print "Publisher: " + channel[(dc, 'publisher')] print print "Items:" for item in channel.items: print " Title: " + item.title print " Link: " + item.link print " Description: " + item.description print " Link creator: " + item[(dc, 'creator')] print " Link date: " + item[(dc, 'date')] print
This module reads RSS 1.0 files and provides objects for accessing and working with them.
The following sections describe the core properties of RSS nodes. In addition to core properties, RSS modules generally add new properties using namespaced properties like this:
channel[(dc, 'publisher')] = 'The Monkeyfist Collective'The following namespace declarations are used:
rdf_ns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
(rdf_ns, 'about') | The URI of the channel. |
title | A string containing the title for the channel. |
link | An alias for (rdf_ns, 'about'). |
description | A string describing the channel. |
image | An Image node. |
items | An array of Item nodes. |
textinput | A TextInput node. |
(rdf_ns, 'about') | The URI of the item. |
title | A string containing the title for the channel. |
link | An alias for (rdf_ns, 'about'). |
description | A string describing the channel. |
(rdf_ns, 'about') | The URI of the image. |
title | A string containing alternative text for the image. |
url | An alias for (rdf_ns, 'about'). |
link | A string containing the URL to the site. |
(rdf_ns, 'about') | The URI to which a textinput submission will be directed (using GET). |
title | A string containing the title of the link. |
description | A string containing a short description of the TextInput field. |
name | A string containing the TextInput field's variable name. |
link | An alias for (rdf_ns, 'about'). |