how to find CNN's feed by going
to their homepage.
Here are the general steps:
- Go to www.cnn.com
- View the source HTML
- Look for the link tag
- Find the link tags that
say the following:
type="application/rss+xml"
Ok. That's pretty general. Let's
get more specific.
It turns out that CNN's home
page has link tags representing
two RSS feeds. Here are the two
feeds as described by CNN:
- CNN - Top Stories [RSS]
- CNN - Recent Stories [RSS]
So, in other words, CNN has two
feeds. One is for top stories
and the other is for recent stories.
Must be that one feed has stories
that are currently dominating the
news and the other has stories
that were recently dominating the
news. Something like that.
Here's specifically how I found
out about these two feeds. I
took the following steps:
- Go to www.cnn.com
- Right click
- A menu appears
- Choose View Source
- Type Control-F
- A search box appears
- Search for link
- Hit F-3 (search again) until
you find the first link tag that
says rel="alternate". - You just found the first feed
- Hit F-3 (search again) until
you find the second link tag that
says rel="alternate". - You just found the second
feed.
Here's what an empty (and rather
useless) link tag looks like:
<link>
An empty link tag is not at all
realistic. Link tags always
have attributes inside of them.
Here's what the link tags we
are searching for look like when
we include only the first
attribute:
<link rel="alternate"
The above is not really a link tag.
It is the beginning fragment of a
link tag. Link tags always end with
a > character (greater-than
character).
One more thing. Both of CNN's feeds
are RSS 2.0 feeds. This attribute
inside the link tag tells us this is true:
type="application/rss+xml
If CNN were to offer an Atom
Feed as well, the type
atrribute would look like
this:
type="application/atom+xml
Note that CNN offers RSS
feeds only. At the time
of this writing, CNN does not
offer an Atom Feed.
Oh, I almost forgot. There's one
more thing to look for inside
of the link tag. That's
the feed address.
Here's the attribute you look
for when you want to find where
the feed is kept:
href="feed.xml"
Of course, the name of the feed
is not likely to be feed.xml.
However, I think you get the idea.
The feed is an XML document
located at some URL.
Enough for now.
Ed Abbott
No comments:
Post a Comment