[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenSearch RSS




Tim Bray wrote:



Check out A9's OpenSearch at http://opensearch.a9.com/ - I'm starting to hear substantial buzz around this thing.


I wonder, is embedding the OpenSearch RSS stuff in Atom going to cause any heartburn? I'm inclined to think not, but would appreciate others having a look.

I get the feeling that OpenSearch + Atom could be real useful. -Tim

Just to see how it would look like, this is what the search result example [1] would be in Atom:
<atom:feed xml:lang="en-us" xmlns:atom="...Atom NS..."
xmlns:os="http://a9.com/-/spec/opensearchrss/1.0/";>
<atom:title>A9.com Search: New York City history</atom:title>
<atom:id>tag:A9.com,2005:New%20York%20City%20history</atom:id>
<atom:link rel="alternate" type="text/html"
href="http://a9.com/New%20York%20City%20history"; />
<atom:subtitle>Search results for "New York City history" at A9.com</atom:subtitle>
<atom:rights>&#169; 2003-2005, A9.com, Inc. or its affiliates.</atom:rights>
<atom:author>
<atom:name>A9.com, Inc.</atom:name>
<atom:uri>http://a9.com/</atom:uri>
</atom:author>
<atom:updated>2005-05-30T23:50:00+02:00</atom:updated>
<os:totalResults>4230000</os:totalResults>
<os:startIndex>1</os:startIndex>
<os:itemsPerPage>10</os:itemsPerPage>


<atom:entry>
<atom:title>New York City History</atom:title>
<atom:link rel="alternate"
href="http://www.columbia.edu/cu/lweb/eguides/amerihist/nyc.html"; />
<atom:id>http://www.columbia.edu/cu/lweb/eguides/amerihist/nyc.html</atom:id>
<atom:updated>2005-05-30T00:00:00+02:00</atom:updated>
<atom:summary>... Harlem.NYC - A virtual tour and information on businesses ... with historic photos of Columbia's own New York neighborhood ... Internet Resources for the City's History. ...</atom:summary>
</atom:entry>
<atom:entry>
<atom:title>Gotham Center for New York City History</atom:title>
<atom:link rel="alternate" href="http://www.gothamcenter.org/"; />
<atom:id>http://www.gothamcenter.org/</atom:id>
<atom:updated>2005-05-30T00:00:00+02:00</atom:updated>
<atom:summary>... Submit Events Edit Your Submission. Main Neighborhood Stories NYC History in the ... The Gotham Center for New York City History is supported by The CUNY Graduate ...</atom:summary>
</atom:entry>
<!-- ... -->
<atom:entry>
<atom:title>Welcome to the Museum of the City of New York</atom:title>
<atom:link rel="alternate" href="http://www.mcny.org/"; />
<atom:id>http://www.mcny.org/</atom:id>
<atom:updated>2005-05-30T00:00:00+02:00</atom:updated>
<atom:summary>... a list with the event staff. Additional information will be included in the confirming email. &copy; Museum of the City of New York.</atom:summary>
</atom:entry>
</atom:feed>


Some comments:

   * I set type="text/html" on the feed's alternate link, because the
     OpenSearch RSS 1.0 Specification [1] says the RSS <link> is "a URL
     that can recreate the search in HTML format", @type is not used in
     entries as it might not be text/html
   * I changed the escaped-HTML &amp;copy; to &#169;, it saves us an
     internal DTD subset while allowing us to use type="text"
   * Atom mandates an atom:author, I added a dummy one
   * Atom mandates an atom:updated in the feed, I added a dummy one; it
     should be set to the latest atom:updated date found in the feed's
     entries, or at least to the date the request was made.
   * Atom mandates an atom:updated in each entry, I added a dummy one;
     it should be set to the last access of the search engine to the
     "result document", or eventually the date the request was made.
     For example, Google is able to give you this date if it has cached
     the document (when you look at a cached page, Google puts a "this
     is Google's cache of <URI> as retrieved on <DATE>" on top of the page.
   * I used the address of the "result document" (permalink?) as the
     atom:id of each entry, because this is the easiest way to do it...

I've put this document online [2], with the "Atom 0.3" namespace URI (http://purl.org/Atom/ns#)

Note that the OpenSearch RSS 1.0 Specification [1] forbids the use of escaped HTML in many elements. If there were an "OpenSearch Atom", it could also be limited to type="text" (and/or type="xhtml", because it's quite easy to transform XHTML to plain text), though A9.com website (which acts as an reader/aggregator for OpenSearch RSS documents) would then not be a valid Atom Processor.

The OpenSearch Description Document [3] would /a priori/ be the same (except of course that it would use a different value in the "Format" element to indicate "OpenSearch Atom" instead of "OpenSearch RSS".

The Atom result document could also link to the next and previous "pages" with additional atom:link elements in the atom:feed, with "extended" @rel values.

[1] http://opensearch.a9.com/spec/opensearchrss/1.0/
[2] http://www.ltgt.net/atom/opensearch.atom
[3] http://opensearch.a9.com/spec/opensearchdescription/1.0/

--
Thomas Broyer