tags:

views:

110

answers:

3

In the rss xml file I have my channel and several items. Typically the item has a title, link, description and maybe time or something. Can I put my own tags in there with additional data I want to send?

Example: Say if was a doing a rss feed to contains weather/temperature info, I might have several item tags, with one for each city. And then in the description I would have my string description. But if I wanted to also put separate tags for temperature, windspeed, high, low, inchesOfRain, etc too I could have something parse that differently on some other client.

A: 

If you want an example of weather RSS feeds, you should definitely take a look at the RSS feeds that are produced by the Weather channel at http://www.weather.com

I remember using those a few years ago to generate weather widgets for a small city's website I helped produce. We would parse out the RSS feed to get the temperature and cloud coverage of our specific zip code's weather.

TheTXI
+1  A: 

Is this what you're looking for?

http://cyber.law.harvard.edu/rss/rss.html#extendingRss

I think Atom has something similar too. You can look at the spec for Atom here:

http://tools.ietf.org/rfc/rfc4287.txt

Todd R
+1  A: 

Yes you can - create a new namespace for your tags (it's standard XML).

An example:

<?xml version="1.0"?>
<rss version="2.0" xmlns:w="http://tempuri.org"&gt;
    <channel>
        ...
        <item>
            <title>Item title</title>
            <description>...</description>
            <w:temperature>...</w:temperature>
            <w:windspeed>...</w:windspeed>
        </item>
    </channel>
</rss>

That said, perhaps you should do a little searching first to see if there's an existing format that meets your needs. Standards == good :)

See http://www.feedforall.com/namespaces.htm, http://base.google.co.uk/support/bin/answer.py?answer=58085&amp;hl=en_GB

elo80ka