Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 121 lines (90 sloc) 2.93 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 <erl>
45
46 out(A) ->
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
47 case yaws_rss:retrieve(test, xml) of
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
48 {ok, Xml} ->
e1cb0d1 Updated RSS documentation.
Tobbe Tornquist authored
49 {content, "text/xml", head()++Xml++tail()};
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
50 _ ->
e1cb0d1 Updated RSS documentation.
Tobbe Tornquist authored
51 {content, "text/xml", ""}
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
52 end.
53
e1cb0d1 Updated RSS documentation.
Tobbe Tornquist authored
54 head() ->
55 "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">
56 <channel>
57 <title>Exampel RSS feed</title>
58 <link>http://www.blaha.org/</link>
59 <description>
60 Bla bla....
61 </description>
62 <language>iso8859-1</language>".
63
64 tail() ->
65 " </channel>
66 </rss>".
67
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
68 </erl>
69
70 ========
71
72 To insert RSS items into the feed from your application, you
73 can write code like:
74
75 ....
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
76 yaws_rss:insert(test, xml, "Yaws now support RSS feeds.",
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
77 "http://www.blaha.org/latest_news.html",
78 "Yaws has now been extended to support....",
79 "Bill Smith").
80 ....
81
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
82 First comes the application (RSSid) then a tag (these were used in
83 rss.yaws when we retrieved the RSS content). Then follows the
84 Title, Link, Description and Creator.
85
86 The idea is that several independent application should be able
87 to use the yaws_rss.erl API without affecting each other. Also,
88 one application may have several RSS feeds (hence the Tag).
89
90
91
92 HOW TO CONFIGURE RSS
93 --------------------
94
95 Inside a <server> block you specify the application you want
96 to produce RSS content as:
97
98 <rss>
99 rss_id = <application>
100 </rss>
101
102 This corresponds to the 'App' argument above and must be
103 defined by the application in question. So, for example,
104 the wikie application is using 'wiki' as rss_id.
105
106 Other, non-mandatory, configuration parameters are (with
107 explanation and default values):
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
108
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
109 <rss>
110 rss_expire = false | days # expire items, or not (false)
fbf6580 Yaws is now RSS capable, see doc/README.rss
Tobbe Tornquist authored
111 rss_days = <integer> # days until expired
30d2427 Added RSS config parameters ro config parser and some more documentat…
Tobbe Tornquist authored
112 rss_rm_exp = <bool> # remove expired items (false)
113 rss_max = <integer> # max no.of items stored (infinite)
114 </rss>
6e45786 Added RSS store/interface.
Tobbe Tornquist authored
115
116 Good luck !
117
118 Tobbe
119
120
Something went wrong with that request. Please try again.