source: project/wiki/eggref/4/rss @ 15666

Last change on this file since 15666 was 15666, checked in by felix winkelmann, 10 years ago

r4 rss doc

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