From 10644594d8c7c02df913ff58b06b47a350965f9b Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Tue, 18 Dec 2007 10:43:01 +0000 Subject: [PATCH] Add initial georss support to rss20 plugin. --- gavinc/rss20 | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/gavinc/rss20 b/gavinc/rss20 index 1f5e5fb..38a2687 100644 --- a/gavinc/rss20 +++ b/gavinc/rss20 @@ -1,8 +1,8 @@ # Blosxom Plugin: rss20 # Author(s): Gavin Carr -# Version: 0.002000 +# Version: 0.003000 # Requires: storydate -# Suggests: absolute, storytags +# Suggests: absolute, storytags, geo # Follows: storydate package rss20; @@ -19,6 +19,7 @@ use vars qw( $copyright $generator $category_list + $georss ); # --- Configuration variables ----- @@ -112,6 +113,14 @@ sub story { $category_list .= qq($_\n) . ' ' x $item_indent; } } + + $georss = ''; + if ($blosxom::plugins{geo} && $geo::latitude && $geo::longitude) { + $georss = qq($geo::latitude $geo::longitude\n) . + ' ' x $item_indent; + } + + return 1; } # --- Private subroutines @@ -138,6 +147,14 @@ sub _load_templates { @@ -200,8 +217,17 @@ STORY ' ' x $item_indent . qq($rss20::trackback_link\n); } - $blosxom::template{$flavour}{'story'} .= <\$body + $blosxom::template{$flavour}{'story'} .= + ' ' x $item_indent . + '$rss20::category_list'; + + # GeoRSS support + if ($blosxom::plugins{geo}) { + $blosxom::template{$flavour}{'story'} .= '$rss20::georss'; + } + + $blosxom::template{$flavour}{'story'} .= <<'STORY'; +$body STORY @@ -230,6 +256,10 @@ rss20 is a blosxom plugin to generate an RSS 2.0 feed of your blog. It is self-contained, including the required flavours, and has a bunch of configuration variables to allow for configuration. +If you're using the L plugin, rss20 will also add georss:point +entries for any items with latitude and longitude metadata set (see +L). + =head2 CONFIGURATION The following package variables can be configured: @@ -277,9 +307,15 @@ plugins that manipulate your story content to have run already. It also should be run after the 'story' or 'prefs' plugins if you want to use those to customise your configuration variables. +Requires the L plugin for setting up story dates in the +right formats, and recommends the L plugin for absolutising +URLs. + =head1 SEE ALSO +L, L, L + Blosxom: http://blosxom.sourceforge.net/ rss20 is based on the 'atomfeed' and 'rss10' plugins, by Rael -- 2.30.2