Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 118 lines (88 sloc) 2.855 kb
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
1
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
2 RSS FEED INTERFACE
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
3 ------------------
4
5 RSS is very cool! To see it in action look no further than Firebird 1.0.
6 Then go to an RSS-enabled site, e.g slashdot.org . Note the little orange
7 icon down in the right corner of the browser window. Click on the icon
8 and add the RSS-feed to you personal toolbar. Then click on your toolbar,
9 on the RSS-bookmark and watch the nice menu of slashdot article-summarys
10 popping up.
11
12 The module yaws_rss.erl provides an RSS store/interface so that
13 you can RSS enable your application. More documentation can be
14 found in the yaws_rss.erl file (edoc).
15
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
16
17 TO CREATE AN RSS FEED
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
18 --------------------
19
20 Make sure your top page has the corresponding link information
21 in the 'head' part as shown in the example below:
22
23 index.html
24 ==========
25 <html>
26 <head>
27 <link rel="alternate"
28 title="Example RSS"
29 href="//localhost:3080/rss.yaws"
30 type="application/rss+xml>
31 <title>Example</title>
32 </head>
33 <body>
34 Hello world
35 </body>
36 </html>
37 =========
38
39 The link info above refers to a file rss.yaws which
40 could look something like this:
41
42 rss.yaws
43 ========
44 <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <channel>
46 <title>Exampel RSS feed</title>
47 <link>http://www.blaha.org/</link>
48 <description>
49 Bla bal....
50 </description>
51 <language>iso8859-1</language>
52
53 <erl>
54
55 out(A) ->
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
56 case yaws_rss:retrieve(test, xml) of
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
57 {ok, Xml} ->
58 {html, [Xml]};
59 _ ->
60 {html, ""}
61 end.
62
63 </erl>
64
65 </channel>
66 </rss>
67 ========
68
69 To insert RSS items into the feed from your application, you
70 can write code like:
71
72 ....
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
73 yaws_rss:insert(test, xml, "Yaws now support RSS feeds.",
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
74 "http://www.blaha.org/latest_news.html",
75 "Yaws has now been extended to support....",
76 "Bill Smith").
77 ....
78
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
79 First comes the application (RSSid) then a tag (these were used in
80 rss.yaws when we retrieved the RSS content). Then follows the
81 Title, Link, Description and Creator.
82
83 The idea is that several independent application should be able
84 to use the yaws_rss.erl API without affecting each other. Also,
85 one application may have several RSS feeds (hence the Tag).
86
87
88
89 HOW TO CONFIGURE RSS
90 --------------------
91
92 Inside a <server> block you specify the application you want
93 to produce RSS content as:
94
95 <rss>
96 rss_id = <application>
97 </rss>
98
99 This corresponds to the 'App' argument above and must be
100 defined by the application in question. So, for example,
101 the wikie application is using 'wiki' as rss_id.
102
103 Other, non-mandatory, configuration parameters are (with
104 explanation and default values):
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
105
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
106 <rss>
107 rss_expire = false | days # expire items, or not (false)
fbf6580 Yaws is now RSS capable, see doc/README.rss
Tobbe Tornquist authored
108 rss_days = <integer> # days until expired
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
109 rss_rm_exp = <bool> # remove expired items (false)
110 rss_max = <integer> # max no.of items stored (infinite)
111 </rss>
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
112
113 Good luck !
114
115 Tobbe
116
117
Something went wrong with that request. Please try again.