[OPEN-ILS-DEV] Opensearch rss2-full - output for various RSS readers

Whalen, Liam Liam.Whalen at NRCan-RNCan.gc.ca
Tue Oct 18 09:03:50 EDT 2011


Our RSS feeds are now working properly on our dev machine, but it took some trial and error to make them play nice with a variety of RSS readers.
I'm sending this message to the dev list to share my testing in case anyone else runs into similar problems.

First, Firefox's Live Bookmarks RSS reader can subscribe to a link that looks like this:

http://catalogue.nrcan.gc.ca/opac/extras/opensearch/1.1/-/rss2-full?searchTerms=item_type%28a%20||%20t%29%20sort%28create_date%29%23descending

However, when you attempt to visit the actual RSS feed through Live Bookmarks, it doesn't work because Live Bookmarks interprets the %23 as an actual #, which confuses opensearch.

To fix this, I replaced the sort(create_date)#descending with &searchSort=create_date&searchSortDir=desc. However, when I went to include these links in a file included in xul/home/index_body.xml, the page would only partially display.  It seems the & characters are causing a problem.  I assume that happens because the server side include is interpreting & as the start of a variable.

To fix this, I stored the link as a server environment variable then used echo to display it.  Like so:

<!--#set var="rss_all_url" value="<a href='http://catalogue.nrcan.gc.ca/opac/extras/opensearch/1.1/NRCan-RNCan/rss2-full?searchTerms=item_type%28a%20%7C%7C%20t%29&searchSort=create_date&searchSortDir=desc'>Recently added All</a>" -->

<!--#echo var="rss_all_url" -->

That fixed the problems with Firefox's Live Bookmarks.

Google Reader has one problem with the first URL.  When searching the default Org Unit, I was using a '-' to default to our top level Org Unit, which is NRCan-RNCan. This made the feed unusable by Google Reader, but when I replaced the '-' with NRCan-RNCan, Google Reader was able to use the feed.  It seems, the '-' causes trouble for Google Reader, so you need to explicitly state the Org Unit in order to get the feed to work.

Finally, My Yahoo was also having trouble using my original feed.  In Yahoo's case, it was the || within then item_type() search modifier that was causing the trouble.  By URL encoding each | as %7C, I was able to make My Yahoo accept the feed.  I was using Firefox's default feed registration system to attempt to load the feed into My Yahoo, which was causing trouble with My Yahoo: My Yahoo wasn't accepting the feed from Firefox on a first try. I needed to refresh the My Yahoo page a couple of times before the feed would work.  Manually entering the feed from My Yahoo's Feeds interface works properly but still needs each | to be encoded as %7C.

I have tested this feed with a stand alone feed reader called FeedDemon, and the feed worked properly with that reader, so hopefully this feed will co-operate with most readers now.

Liam

Natural Resources Canada Library / Bibliothèque de Ressources naturelles Canada
615 rue Booth Street, 121, Ottawa, ON
Canada K1A 0E9
Telephone / Téléphone : 613-995-4180
lwhalen at nrcan-rncan.gc.ca
Web: http://www.nrcan.gc.ca/library/


More information about the Open-ils-dev mailing list