News feeds
Where are we?
We’ve looked at how Web pages are delivered to browsers. But there are other ways of giving users information. In this lesson, we’ll talk about RSS, a technology that complements standard Web pages.
This lesson’s goals
By the end of this lesson, you should:
- Know why RSS exists.
- Know what a news reader does.
Feeds and readers
HTML is the main language of the Web. But there are other languages and formats as well.
One of the most important is RSS, which stands for really simple syndication or rich site summary, depending on who you ask. RSS is used to create news feeds.
A news feed lets people know what’s new on a site, without having to keep checking the site.
Suppose you run a site on dog treats. Every week, you publish two or three new articles. You update your home page to say “Hey, there are some new articles!”
You also put a new item on sale every week. You put that on your home page as well. Sometimes you put more than one item on sale, if you can get a special deal from the manufacturer.
Sometimes you change articles that are already on your site. For example, you have a page on your site called Top Ten Treats. You revise it every six months, or when you learn something important (like a manufacturer goes out of business).
How would people know when you’ve added a new article? Or put a new item on sale? Or updated your Top Ten list?
Here’s Lucy.
Lucy likes your site. She likes to know about new articles, sales, and especially your Top Ten list.
Lucy likes other sites, as well. Sites about dog food, vacation spots, fashion leashes, jeweled collars, walking clubs, canine celebs, doggerel, ... Lots of sites.
But how is Lucy to keep up, if she has to check each site? How is she to know when you have something new on your site?
Is there a better way? Suppose Lucy could see a single list, that summarized all of the new stuff on every site she was interested in.

Figure 1. News feeds
When you has something new on your site, you would add an item on your site’s news feed. Every other site would do the same: add an item to its news feed. So each site would have its own feed.
Lucy would use a news reader, software that can gather a bunch of news feeds together. Lucy uses the reader to check the feeds from the sites she’s interested in. She can keep up-to-date from one place.
Inside your feed
Suppose you change your Top Ten list. You’d add an item to your feed.
New Top Ten list today!
On Friday, you add a new recipe:
Liver treats recipe to die for.
New Top Ten List today!
On Monday, you change the item on sale for that week:
On sale: Limdoodle Bacon Bites!
Liver treats recipe to die for.
New Top Ten List today!
Your news feed is a stack of items, growing as you add new announcements.
Each item is HTML. It can have links, images, and other things. You decide to keep each item short, with a link to your content. For example:
<p> Liver treats recipe to <em>die</em> for. </p> <p> <a href="http://evildogtreats.com/liver-die.html">Check them out</a> </p>
Figure 2. HTML for feed item
This would look like:

Figure 3. Feed item
When you add an item, you add it to a file in the RSS format. We won’t go over the format here.
The RSS file has a URL, like http://evildogtreats.com/newsfeed.xml. Notice that the extension is .xml, not html.
Each one of these .xml files is a news feed. You can make as many of them as you want. For example, you might have your main feed, and another for dog show announcements.
News readers
RSS isn’t designed to be read by a human directly. It’s designed to be read by a program, called a news reader. News readers display the RSS data as something a human (or dog) can use.
There are lots of news readers. I use Google Reader, but others are just as good.
If someone wants to subscribe to your dog treats feed, s/he would give their news reader the URL of your RSS file: http://evildogtreats.com/newsfeed.xml. Every time the news reader starts, it checks every RSS file it has been given, and lists the new entries. This lets the user see all of his/her feeds in one spot.
Here’s part of the screen of my Google Reader.

Figure 3. List of feeds
It shows some of the feeds I subscribe to.
When I click on a feed, the reader shows its items:

Figure 4. List of a feed’s items
Items I haven’t looked at yet have their titles in bold.
Web browsers have features to make subscribing to news feed easier. For example, when a Web page contains a reference to a news feed in a special part of the HTML code, Firefox adds an icon to its address bar:

Figure 5. Firefox feed icon
Safari, a browser from Apple, uses a different button:

Figure 6. Safari feed icon
Once you click on one of these icons, your browser will usually preview the news feed, and let you tell your news reader to subscribe to it.
CoreDogs has a news feed at http://coredogs.com/rss.xml.
If you don’t use news readers, learn about them, pick one, and subscribe to some feeds.
Exercise: News readers
Webers keep up with developments in their worlds. Subscribe to some feeds with Google Reader or some other news reader (if you want to use Google Reader, you’ll need a free Google account first.)
Note that you shouldn’t limit yourself to technical news. If you work for an employer in, say, the dog food industry (yum!), consider subscribing to a feed on that industry. If you’re into knitting, you should be able to find some good feeds.
To get started, have a look at the feeds from A List Apart, MakeUseOf, and LifeHacker.
If you find some useful feeds, please add a comment to this exercise.
(Log in to enter your solution to this exercise.)
Summary
In this lesson, you:
- Learned why RSS exists.
- Learned what a news reader does.


