Including Calais Document Identifier in Existing Feeds

The Calais document identifier is declared as an element (named "docIdd") under the namespace of http://s.opencalais.com/1/pred. To include the Calais identifier in an existing feed, we need to add a reference to this URI.

We will explain the process for RSS 2.0 and Atom 1.0, the most popular web syndication formats.

RSS 2.0

Under the <rss> node, declare a namespace pointing to the above URI with a valid prefix. Here's an example of how an <rss> node would look with this declaration:

<rss version="2.0" xmlns:calais="http://s.opencalais.com/1/pred/">

For all <item> nodes, which represent individual stories, add the Calais identifier as a new element. For example,

<calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f84</calais:docId>

A complete sample is presented here:

 <?xml version="1.0"?>
<rss version="2.0" xmlns:calais="http://s.opencalais.com/1/pred/">
<channel>
<title>Lift Off News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>

<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<ttl>5</ttl>

<item>
<title>Star City</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
<description>How do Americans get ready to work with Russians aboard the
International Space Station? They take a crash course in culture, language
and protocol at Russia's Star City.</description>
<pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
<calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f84</calais:docId>
</item>
<item>
<title>Space Exploration</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Sky watchers in Europe, Asia, and parts of Alaska and Canada
will experience a partial eclipse of the Sun on Saturday, May 31.</description>
<pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate>

<guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid>
<calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f85</calais:docId>
</item>

<item>
<title>The Engine That Does More</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>
<description>Before man travels to Mars, NASA hopes to design new engines
that will let us fly through the Solar System more quickly. The proposed
VASIMR engine would do that.</description>

<pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>
<calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f86</calais:docId>
</item>

<item>
<title>Astronauts' Dirty Laundry</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</link>
<description>Compared to earlier spacecraft, the International Space
Station has many luxuries, but laundry facilities are not one of them.
Instead, astronauts have other options.</description>
<pubDate>Tue, 20 May 2003 08:56:02 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>
<calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f87</calais:docId>
</item>
</channel>
</rss>

Atom 1.0

Under the <feed> node, declare a namespace pointing to the above URI with a valid prefix. Here is an example of how the <feed> node would look with this declaration:

<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:calais="http://s.opencalais.com/1/pred/">

For all <entry> nodes, which represent individual stories, add the Calais identifier as a new element. For example:

 <calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f84</calais:docId> 

A complete sample is presented here:

 

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:calais="http://s.opencalais.com/1/pred/">
 
 <title>Example Feed</title>
 <subtitle>A subtitle.</subtitle>
 <link href="http://example.org/feed/" rel="self"/>
 <link href="http://example.org/"/>
 <updated>2003-12-13T18:30:02Z</updated>
 <author>
   <name>John Doe</name>
   <email>johndoe@example.com</email>
 </author>
 <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
 
 <entry>
   <title>Atom-Powered Robots Run Amok</title>
   <link href="http://example.org/2003/12/13/atom03"/>
   <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
   <updated>2003-12-13T18:30:02Z</updated>
   <summary>Some text.</summary>
   <calais:docId>http://d.opencalais.com/dochash-1/ebc77f22-9b9d-3ff2-96c2-5bf4d54e8f84</calais:docId>
 </entry>
 
</feed>