source: project/wiki/rss @ 9582

Last change on this file since 9582 was 9582, checked in by sjamaan, 12 years ago

Add wikified rss docs

File size: 3.8 KB
Line 
1[[tags: egg]]
2
3== rss
4
5[[toc:]]
6
7=== Description
8
9An RSS parser
10
11=== Author
12
13[[felix winkelmann]]
14
15=== Requirements
16
17[[ssax]]
18
19=== Download
20
21[[http://www.call-with-current-continuation.org/eggs/rss.egg|rss.egg]]
22
23=== Documentation
24
25A basic RSS parser, supporting 0.92, 1.0 and 2.0 formats.
26
27All errors signalled by the feed reader are composite conditions of the {{exn}} and {{rss}} kinds.
28
29<procedure>(rss:read [PORT])</procedure>
30
31Reads an RSS feed from the given {{PORT}}, or from the value of
32{{(current-input-port)}}, if no port is specified. A {{rss:feed}}
33record is returned.
34
35<record>rss:feed</record>
36<procedure>(rss:feed? x)</procedure>
37<procedure>(rss:feed-version FEED)</procedure>
38<procedure>(rss:feed-channel FEED)</procedure>
39<procedure>(rss:feed-items FEED)</procedure>
40
41A record that holds information for an RSS feed. The {{version}} field
42contains a string, the {{channel}} field and the {{items}} hold a
43single {{rss:item}} and a list of {{rss:item}}s, respectively.
44
45<record>rss:item</record>
46<procedure>(rss:item? X)</procedure>
47<procedure>(rss:item-title ITEM)</procedure>
48<procedure>(rss:item-link ITEM)</procedure>
49<procedure>(rss:item-description ITEM)</procedure>
50<procedure>(rss:item-attributes ITEM)</procedure>
51
52A record containing data of a RSS item. The {{title}}, {{link}} and
53{{description}} fields are strings, the {{attributes}} field holds an
54association list mapping symbols to strings and contain all
55sub-elements of a specific RSS item, including the {{title}}, {{link}}
56and {{description}} values.  So:
57
58  (eq? (alist-ref 'title (rss:item-attributes ITEM)) (rss:item-title ITEM))  ==>  #t
59
60The {{item}} attribute is an SXML expression of the form
61
62  (image (title STRING) ...)
63
64where {{...}} hold additional subelements of the image attribute.
65
66<procedure>(rss:item-attribute ITEM SYMBOL)</procedure>
67
68Returns the attribute {{SYMBOL}} of the RSS feed item {{ITEM}} or
69{{#f}} if the item does not contain an attribute of this name.
70
71<procedure>(rss:item=? ITEM ITEM)</procedure>
72
73Returns {{#t}} if the items have identical GUID attributes or (if no
74GUIDs are available) if the items have the same contents.
75
76=== Changelog
77
78* 1.2 fixed broken .meta file [reported by Mario Goulart]
79* 1.1 Small fix in {{rss:item=?}} by Daishi Kato
80* 1.0 Initial release
81
82=== License
83
84  Copyright (c) 2004, Felix L. Winkelmann
85  All rights reserved.
86 
87  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
88  conditions are met:
89 
90    Redistributions of source code must retain the above copyright notice, this list of conditions and the following
91      disclaimer.
92    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
93      disclaimer in the documentation and/or other materials provided with the distribution.
94    Neither the name of the author nor the names of its contributors may be used to endorse or promote
95      products derived from this software without specific prior written permission.
96 
97  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
98  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
99  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
100  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
101  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
102  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
103  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
104  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
105  POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.