Basic Guide to Creating an RSS News Feed

[ Author: Kevin Lanahan, Dept of Conservation, 573.522.5114, kevin.lanahan@mdc.mo.gov ]
[ Download the Basic Guide to Creating an RSS News Feed pdf file]


Hey, kids, it's fun and easy to make your own RSS news feed with everyday items you can find on your own desktop! 

All you need is a text editor and a template, and you are ready to have your news on the State of Missouri Home page!  Are you ready?  Let's start!

What is RSS?

RSS (Real Simple Syndication) is a way to lead other people to articles on your website.  You put your caption, link, publication date and a couple of other items in an XML file on your website and the State Portal will read it and let other people see your news items on the state portal! 

XML?  What's that?

XML stands for eXtensible Markup Language.  It is a way to pass data from one program to another.  Don't worry, for what we are doing, it isn't that hard.

How do I start?

Well, you better know the rules first.  Read the rules on the DMD site.

Download the template first.  This is like a page in a coloring book.  You have to stay in the lines, though.  The template is just a text file.  It won't bite.  We'll look at each section in the template.

Header

<?xml version="1.0" ?>
< rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">

The first part of the file tells computers that this is an XML file, and it better go check these other sites to find out what to do with the rest of the document.  Don't touch this part, or you'll ruin the magic!

Channel

<channel>
  <title>Missouri Department of Insurance</title>
  <link>http://insurance.state.mo.us/news</link>
  <description>The latest news from MDI News.</description>
  <language>en-us</language>
  <pubDate>Wed, 26 Mar 2003 16:31:20 GMT</pubDate>
  <copyright>Copyright MDI News</copyright>
  <lastBuildDate>Mon, 28 Jul 2003 20:25:47 GMT</lastBuildDate>
< image>
  <title>Missouri Department of Insurance</title>
  <url>http://insurance.mo.gov/graphics/coollogo.gif</url>
  <link>http://insurance.mo.gov</link>
  <width>88</width>
  <height>31</height>
  <description>News for the insurance-wise</description>
  </image>

The second part starts with the word "channel".  This part tells computers about your site.  You have to have these tags in your channel:

The <title> should be your agency's name. 

The <link> should direct people to your news page (if you have one) or your home page (if you don't have a news page).

The <description> should tell people what is in your news feed ("Mmmm, donuts!")

There are other tags that you can add if you wish.  They make your site tastier.

<language> should be "en-us," unless your site is written in French or Spanish.

<pubDate> tells when your news feed was born (or re-born).  The way the date is displayed is special, and the format must be followed down to the last comma and colon.  If you don't follow the rules, nobody will be able to see your hard work!

<copyright> lets people know they better not copy off your paper.  They can create their own newsfeed!

<lastBuildDate> lets all your friends know when you last added to your newsfeed.

There's lots of other fun tags you can use.  You can read about them at http://blogs.law.harvard.edu/tech/rss (If it comes from Harvard, you know it's good!)

Image

<image>

  <title>Missouri Department of Insurance</title>

  <url>http://insurance.mo.gov/graphics/neato-logo.gif</url>

  <link>http://insurance.mo.gov</link>

  <width>88</width>

  <height>31</height>

  <description>News for the insurance-wise</description>

  </image>

The third part is optional, but fun.  It lets you have a pretty picture to go with your news feed. 

<title> is the name of your agency, just like in <channel>.

<url> is where your picture lives.  Use the full address!

<link> is where you want your friends to go when they click on your picture.  It should probably work just like the <link> in <channel>.

<description> tells your friends what the picture means.  It works just like our friend "alt" for all the pictures on your web page.  You can use this, but you don't have to.

<width> and <height> are optional, but nice, like sprinkles on your ice cream sundae.  They tell your friends' newsreaders how big your picture is.  Don't make it bigger than 144 pixels wide and 400 pixels high.  That would be bad.  You can use the default size of 88 pixels wide by 31 pixels high, and see how creative you can be!

Item

<item>

  <title>MDI restrained from acting against auto warranty firm; consumers should contact Nixon with complaints</title>

  <link>http://insurance.state.mo.us/ news/2003078.htm</link>

  <pubDate>Mon, 28 Jul 2003 20:25:46 GMT</pubDate>

  </item>

<item> is a list of each item in your news feed.  You can have up to fifteen, but you'd be better off sticking with about five to start with.  That's as many as most people have on their hand. 

You will need three elements in each <item>. 

<title> is usually the headline of your article.  Headlines are good, because they let your friends know what you wrote for them to read.  Remember, brevity is the soul of wit!

<link> (or <guid>) is a special, unique link to your news article.  Unique means you don't use that link (or guid) anywhere else!  "guid" means "Globally Unique Identifier."

<pubDate> tells your friends when you posted your item.  You have to have this for the state portal, because it's what tells the portal how often your item shows up on the state home page.  You have to use the exact format, just like with <channel><pubDate>.  It is like coloring in the lines.  Sometimes you have to do it.

There's lots of other exciting elements you can add, but that's up to you.  You can find out about them at http://blogs.law.harvard.edu/tech/rss.

For each item, just make another <item> holder. 

Before you stop, though, remember to close the <channel> tag with </channel>.

Save your work.  Put a title on it.  Call it "newsfeed.xml". 

How does this get on the State Portal?

Well, first, you have to put your news feed on the web.  The best way to do that would be to make a special folder named "xml" in your website, and then put the newsfeed.xml file in your new special folder. 

Now you need to tell your friends about it.  The most important friend is the State Webmaster.  She lives at oawebmaster@mail.oa.state.mo.us.  Tell her where to find your news feed.  She'll take care of the rest.

Gee, that wasn't so hard!

But the work is just beginning.  Every time you have a new news item, you will need to open up this file and change it.  But you never have to tell the State Webmaster again.  She will check it every hour and make sure your changes get posted on the State Portal.

If you get tired of doing this by hand each time you have a news release, you may want to think about automating the process.  Automation is like magic, only more work at first. See the DMD site to see how other webmasters have done theirs!


Sample template:

<?xml version="1.0" ?>
< rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
< channel>
  <title>MDI News</title>
  <link>http://insurance.state.mo.us/news</link>
  <description>The latest news from MDI News.</description>
  <language>en-us</language>
  <pubDate>Wed, 26 Mar 2003 16:31:20 GMT</pubDate>
  <copyright>Copyright MDI News</copyright>
  <lastBuildDate>Mon, 28 Jul 2003 20:25:47 GMT</lastBuildDate>
  <image>
  <title>Missouri Department of Insurance</title>
  <url>http://insurance.mo.gov/graphics/coollogo.gif</url>
  <link>http://insurance.mo.gov</link>
  <width>88</width>
  <height>31</height>
  <description>News for the insurance-wise</description>
  </image>
< item>
 < title>MDI restrained from acting against auto warranty firm; consumers should contact Nixon with complaints</title>
 <link>http://insurance.state.mo.us/cgi-bin/news/news1.cgi?sr=2&newsid=EpVAukFAuyktkcXUtL</link>
 <pubDate>Mon, 28 Jul 2003 20:25:46 GMT</pubDate>
 </item>
<item>
 <title>Medical Malpractice Joint Underwriting Association Public Hearing Agenda</title>
 <link>http://insurance.state.mo.us/cgi-bin/news/news1.cgi?sr=2&newsid=EpVZlVFykEkAWjXRJR</link>
 <pubDate>Thu, 10 Jul 2003 16:13:41 GMT</pubDate>
 </item>
 </channel>
 </rss>

[ top