From 1fbf1dc7e496f9230207049fd82c66ef99d4e45a Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 20 Mar 2008 01:40:07 +0000 Subject: [PATCH] fixing the freshmeat feed link; moving to rss v2 from atom for feeds, to make feed readers happier git-svn-id: svn://svn.open-ils.org/ILS/trunk@9092 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 14 +++++++------- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm | 8 ++++---- Open-ILS/web/opac/skin/default/js/myopac.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 2450ab75d6..4c2368a02d 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -746,8 +746,8 @@ sub bookbag_feed { $feed->creator($host); $feed->update_ts(gmtime_ISO8601()); - $feed->link(rss => $base . "/rss2-full/$id" => 'application/rss+xml'); - $feed->link(alternate => $base . "/atom-full/$id" => 'application/atom+xml'); + $feed->link(alternate => $base . "/rss2-full/$id" => 'application/rss+xml'); + $feed->link(atom => $base . "/atom-full/$id" => 'application/atom+xml'); $feed->link(html => $base . "/html-full/$id" => 'text/html'); $feed->link(unapi => $unapi); @@ -782,7 +782,7 @@ sub changes_feed { my $url = $cgi->url(-path_info=>$add_path); my $root = (split 'feed', $url)[0]; - my $base = (split 'freshmeat', $url)[0] . 'freshmeat'; + my $base = (split 'freshmeat', $url)[0] . '/freshmeat'; my $unapi = (split 'feed', $url)[0] . 'unapi'; my $path = $cgi->path_info; @@ -815,8 +815,8 @@ sub changes_feed { $feed->creator($host); $feed->update_ts(gmtime_ISO8601()); - $feed->link(rss => $base . "/rss2-full/$rtype/$axis/$limit/$date" => 'application/rss+xml'); - $feed->link(alternate => $base . "/atom-full/$rtype/$axis/$limit/$date" => 'application/atom+xml'); + $feed->link(alternate => $base . "/rss2-full/$rtype/$axis/$limit/$date" => 'application/rss+xml'); + $feed->link(atom => $base . "/atom-full/$rtype/$axis/$limit/$date" => 'application/atom+xml'); $feed->link(html => $base . "/html-full/$rtype/$axis/$limit/$date" => 'text/html'); $feed->link(unapi => $unapi); @@ -1112,13 +1112,13 @@ sub opensearch_feed { ); $feed->link( - rss => + alternate => $base . "/$version/$org/rss2-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" => 'application/rss+xml' ); $feed->link( - alternate => + atom => $base . "/$version/$org/atom-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" => 'application/atom+xml' ); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm index 44a5f74648..9ad6c2c3ca 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm @@ -235,7 +235,7 @@ sub new { my $self = $class->SUPER::build(''); $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', undef); $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', 'atom'); - $self->{type} = 'application/xml'; + $self->{type} = 'application/atom+xml'; $self->{item_xpath} = '/atom:feed'; return $self; } @@ -299,7 +299,7 @@ sub new { $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', 'atom'); $self->{item_xpath} = '/atom:entry'; $self->{holdings_xpath} = '/atom:entry'; - $self->{type} = 'application/xml'; + $self->{type} = 'application/atom+xml'; return $self; } @@ -312,7 +312,7 @@ use base 'OpenILS::WWW::SuperCat::Feed'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/rss+xml'; $self->{item_xpath} = '/rss/channel'; return $self; } @@ -361,7 +361,7 @@ sub new { my $class = shift; my $xml = shift; my $self = $class->SUPER::build($xml); - $self->{type} = 'application/xml'; + $self->{type} = 'application/rss+xml'; $self->{item_xpath} = '/item'; $self->{holdings_xpath} = '/item'; return $self; diff --git a/Open-ILS/web/opac/skin/default/js/myopac.js b/Open-ILS/web/opac/skin/default/js/myopac.js index 5dbb4b9d58..b4b23880d7 100644 --- a/Open-ILS/web/opac/skin/default/js/myopac.js +++ b/Open-ILS/web/opac/skin/default/js/myopac.js @@ -980,7 +980,7 @@ function myOPACShowBookbags(force) { unHideMe(link); link = $n(row, 'myopac_bb_published_atom'); - link.setAttribute('href', buildExtrasLink( 'feed/bookbag/atom-full/'+cont.id(), false)); + link.setAttribute('href', buildExtrasLink( 'feed/bookbag/rss2-full/'+cont.id(), false)); link.setAttribute('target', '_blank' ); unHideMe(link); -- 2.43.2