Jump to content

RSS Feed.


unhappychild

Recommended Posts

Please excuse my n00bish ness but, i want to create an rss feed for the news section of my site, i have read through the tutorial and do i understand correctly that

<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0"><channel><title>W3Schools</title><link>http://www.w3schools.com</link><description>W3Schools Web Tutorials </description><item><title>RSS Tutorial</title><link>http://www.w3schools.com/rss</link><description>Check out the RSS tutorialon W3Schools.com</description></item></channel></rss>

Is all i put and but of course with my relevent information?or have i missed the point compleatly. also do i aunch that as its own site i.e. www.mysite.com/rss ?Cheers

Link to comment
Share on other sites

Hi,Welcome to w3schools and to our discussion forum. I'll try to answer your question as directly as possible, just let me know if you need more explanation.Yes, your code does satisfy the minimum requirements for RSS v2.0. Save it as a .xml file and upload it to your server. The URL will depend on a couple things. If you call the file abcdefg.xml and put it on your root - then your RSS feed can be found at http://www.yourdomain.com/abcdefg.xml. If you want the URL to be http://www.yourdomain.com/rss then you will have to set the default file to load for the RSS folder to be what ever file name you assign your feed. Either way, when you are done, you can always validate your code here:http://feedvalidator.org/This is an example of the latest feed I created:http://www.pedialink.org/_rss/news-rss.cfmI use a server side scripting language (Cold Fusion) to generate my RSS - that is why mine ends with .cfm. Although it is not an XML file, the Cold Fusion server, just like an asp or php page, can return the content as an XML mime type.One thing you will want to do is, on the webpage that shows the news, place the laternate source tag so that smart browsers and applications can tell the visitor that the informaiton is alternately available in and RSS feed:<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.pedialink.org/_rss/news-rss.cfm" />Let me know if you have any other questions.

Link to comment
Share on other sites

hmmm, so does this mean i have to create a new rss feed for each item?or i have a blog on my page so it would be like this

<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0"><channel><title>Blog</title><link>http://www.mywebsite.com/blog</link><description>My Blog </description><item><title>My Blog</title><link>http://www.mywebsite.com/blog/blog.xml</link><description>My Blog</description></item></channel></rss>

And every time i post it will update?thanks for your reply :)

Link to comment
Share on other sites

<channel><title>Blog</title><link>http://www.mywebsite.com/blog</link><description>My Blog </description>

This shows an information about the feed itself. What's it's title, where it's allocated and a short description of it. Again I'll say: the feed!each <item> element holds (what it's name implies) each item in your feed, or in other words: each one of the news, each update, each whatever...You just add new <item> elements above the latest one instead of making another file. RSS aggregators automatically find what's new by comparing what they have and what they don't and show it to the user as an unreaded news item.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...