Mercurial > blahgd
changeset 12:b5ea996aa617
feed: parse comment feed PATH_INFOs
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Tue, 03 Feb 2009 17:12:59 -0500 |
parents | 41327f4785ac |
children | 76cee581f48b |
files | feed.cgi |
diffstat | 1 files changed, 30 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/feed.cgi Tue Feb 03 15:01:31 2009 -0500 +++ b/feed.cgi Tue Feb 03 17:12:59 2009 -0500 @@ -3,15 +3,30 @@ case "$PATH_INFO" in /rss) fmt="rss" - CONTENT_TYPE="text/xml; charset=UTF-8" + view="index" ;; /rss2) fmt="rss2" - CONTENT_TYPE="text/xml; charset=UTF-8" + view="index" ;; /atom) fmt="atom" - CONTENT_TYPE="application/atom+xml; charset=UTF-8" + view="index" + ;; + /rss/[0-9]*) + fmt="rss" + view="comments" + postid="`echo $PATH_INFO | cut -d/ -f3`" + ;; + /rss2/[0-9]*) + fmt="rss2" + view="comments" + postid="`echo $PATH_INFO | cut -d/ -f3`" + ;; + /atom/[0-9]*) + fmt="atom" + view="comments" + postid="`echo $PATH_INFO | cut -d/ -f3`" ;; *) echo "Location: /blahg-test/" @@ -20,6 +35,18 @@ ;; esac +case "$fmt" in + rss) + CONTENT_TYPE="text/xml; charset=UTF-8" + ;; + rss2) + CONTENT_TYPE="text/xml; charset=UTF-8" + ;; + atom) + CONTENT_TYPE="application/atom+xml; charset=UTF-8" + ;; +esac + . common-head.sh ##########################