Re: OT. RSS feed.
"Roedy Green" <see_website@mindprod.com.invalid> wrote in message
news:rc81b31s3p7f7n7sn1022s88edphng9l41@4ax.com...
Good idea. That's what I'm doing now for my site.
I have done some HowTo's about that:
http://www.rgagnon.com/bigindex.html#java-xml
I have tried some (free) tools to create my feed but I went back to
TextPad!
Does RSS require server side code or you do just create a great wad of
little xml files in a magic directory?
The idea behind RSS is that your web server hosts an XML file, which a
client (the RSS reader) will periodically download (say every 2 hours). I
forget the exact name of the elements, the the XML file holds a list of
entries, with each entry having a title, a summary, and a link to the
webpage where the full content can be viewed. So something like (again,
with fictious element names):
<rss>
<entry href="http://myblog.net/viewEntry.jsp?id=842">
<title>Pictures of my cat</title>
<summary>Isn't my cat adorable? Her name i... <a
href="http://myblog.net/viewEntry.jsp?id=842">[Read
more]</a></summary>
</entry>
<entry href="http://myblog.net/viewEntry.jsp?id=841">
<title>My favorite song</title>
<summary>Here's the lyrics to my favori... <a
href="http://myblog.net/viewEntry.jsp?id=841">[Read
more]</a></summary>
</entry>
</rss>
Note that if you include HTML in your summary, you have to escape them
one level, so that "<a href>" becomes "<a href>".
Because an RSS reader will download the RSS file periodically, it's
customary to make that file fairly small (for every reader who subscribes
to your site, you may get 24 or more hits per day; so with 100
subscribers, that's 2400 hits to your RSS file per day). Thus the RSS file
typically contains only the most recent 10 or 20 or 25 entries, depending
on how frequent the updates arrive.
It's up to the client software to determine which entries have already
been read by its user, and which are new, and they use various heuristics
to detect that stuff. Perhaps they keep a hash of all the old entry
elements or something along those lines.
If you already have server-side code to handle all your other stuff,
then you *probably* have all your content in a database somewhere, with
timestamps. If that's the case, you can generate your RSS feed dynamically
on the server. Simply run your SQL query to get the title, ids and
summary, and then truncate the summary at, say, 200 characters. Then
generate the XML file accordingly.
Otherwise, while it's possible do update the RSS file by hand, it's
tedious.
- Oliver