Index: openacs-4/packages/rss-support/tcl/rss-generation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/tcl/rss-generation-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/rss-support/tcl/rss-generation-procs.tcl 30 Nov 2002 17:44:11 -0000 1.7 +++ openacs-4/packages/rss-support/tcl/rss-generation-procs.tcl 28 Sep 2003 16:24:09 -0000 1.8 @@ -11,6 +11,80 @@ } +ad_proc rss_gen_200 { + {-channel_title ""} + {-channel_link ""} + {-channel_description ""} + {-image ""} + {-items ""} + {-channel_language "en-us"} + {-channel_copyright ""} + {-channel_managingEditor ""} + {-channel_webMaster ""} + {-channel_pubDate ""} + {-channel_rating ""} + {-channel_pubDate ""} + {-channel_lastBuildDate ""} + {-channel_skipDays ""} + {-channel_skipHours ""} + +} { + generate an rss 2.0 xml feed +} { + + set rss "" + + if {[empty_string_p $channel_title]} { + error "argument channel_title not provided" + } + if {[empty_string_p $channel_link]} { + error "argument channel_link not provided" + } + if {[empty_string_p $channel_description]} { + error "argument channel_description not provided" + } + + set date_format "%a, %d %b %Y %H:%M:%S %Z" + set channel_date [clock format [clock seconds] -format $date_format] + + append rss {} \n + append rss {} \n + + append rss "[ad_quotehtml $channel_title]" \n + append rss "$channel_link" \n + append rss "[ad_quotehtml $channel_description]" \n + + append rss {OpenACS 5.0} \n + append rss "[ad_quotehtml $channel_date]" \n + + # now top level items + foreach item $items { + array unset iarray + array set iarray $item + append rss {} \n + + append rss "[ad_quotehtml $iarray(title)]" \n + + append rss "[ad_quotehtml $iarray(link)]" \n + append rss {} [ad_quotehtml $iarray(link)] {} \n + + if {[info exists iarray(description)]} { + append rss "[ad_quotehtml $iarray(description)]" \n + } + + if {[info exists iarray(timestamp)]} { + append rss "[ad_quotehtml $iarray(timestamp)]" \n + } + + append rss {} \n + } + + append rss {} \n + append rss {} \n + + return $rss +} + ad_proc rss_gen_100 { { -channel_title "" @@ -389,6 +463,26 @@ } { set rss "\n" switch $version { + 200 - + 2.00 - + 2.0 - + 2 { + append rss [rss_gen_200 \ + -channel_title $channel_title \ + -channel_link $channel_link \ + -channel_description $channel_description \ + -image $image \ + -items $items \ + -channel_language "en-us" \ + -channel_copyright "" \ + -channel_managingEditor "" \ + -channel_webMaster "" \ + -channel_rating "" \ + -channel_pubDate "" \ + -channel_lastBuildDate "" \ + -channel_skipDays "" \ + -channel_skipHours ""] + } 100 - 1.00 - 1.0 -