Wednesday, July 27, 2005

Adding an RSS feed to your Site or blog - Part 2

Once you have considered all the Pitfalls. Now It's time to get cracking.

First of all write your feed. I used Notepad, It is installed on all windows machines with no need to add extra third party software. Don't get me wrong, Dreamweaver is essential for any webcoder and will do nicely, if you dont have DW...use notepad.


Right then , now you need some code.

Your XML feed will start something like this.....I hope this is clear enough?




Basically the feed defines ...what it is, this helps the browser understand the document type.
Next we have the channel tag...this is like the TV channel...defining what you are

Next, enter information about your feed/blog that includes:
Title, Link to homepage, Description of the site, Language, copyright info,
where the
documents come from and the last build date.




For ever more this info wont change.

Now for the really fun part.

Next we add the information about each feed entry or article. Create Item tags
and between them place the title, description, Published date, and link to
that article.



ok, Nearly there. Now Close the channel and RSS tags.

Save as
feed.xml.

Instead of re-inventing the wheel why not just borrow some from a tutorial site.
Evagoras Charalambous's site has the best tutorial I could find.
It is straightforward, he breaks it down,
and gives you code to see and download. Don't just take my word for it.

Read His Tutorial

Adding an RSS feed to your Site or blog - The Issues to consider

Adding an Rss Feed to your site is something that every CLC and School should be thinking of doing. Not only does it allow you to deliver your "up to date" content directly to your users but it can help promote your website to a wider audience.

Unless you are prepared to pay for a managed service such as "word Press" then you are going to be limited before you start. When I say Limited, What I mean is this.

1. You will need to consider using a free service such as blogger, Like I'm doing now. 2. You will have to write your own feed, and manually update it.

Neither Solution is perfect.

Option 1 is good but, you will have to ensure that if your blog is educational, that the blogger toolbar has been removed. The reason for this is that the "view next blog" button may take you on to some unsuitable material. Your feed will auto update every time you update your blog.
There are drawbacks though .

Do you really want your school website to resemble a weblog? I personally think they lack soul, they aren't on your server, unless you specify a server for them to operate off. Also they have a space restriction, if you want to exceed the standard 5mb then you have to pay for extra storage.

That said they work, they are standards compliant and they don't make you sweat over the code.


Option 2
is also good, Having the site on your own server allows you greater control and hopefully you will be covered for the storage space issue as you will have already sorted that out with your web host.

Problems you might face are 1. Setting up the RSS feed using xml. 2. Adding stylesheets to the feed itself 3. Styling the XML feed using XSLT.

This stuff is a little tricky if you have no programming knowledge.

I know HTML and a bit of XML, ASP and CSS so I do Ok even though I'm not designer than programmer.

In addition, updating the feed by hand everytime you update the site is a bit of a pain.

It's not really that bad, but if your site is database driven and you know a Brilliant ASP/PHP programmer get them to write a script to automate the process.

Ok folks, in the next Post I'll show you how I did it.