projects
/
matthijs
/
upstream
/
blosxom-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c2ded0
)
Add georss support to atomfeed.
author
Gavin Carr
<gonzai@users.sourceforge.net>
Sun, 30 Dec 2007 21:12:44 +0000
(21:12 +0000)
committer
Gavin Carr
<gonzai@users.sourceforge.net>
Sun, 30 Dec 2007 21:12:44 +0000
(21:12 +0000)
general/atomfeed
patch
|
blob
|
history
diff --git
a/general/atomfeed
b/general/atomfeed
index 30859959f93bc70f4c7707d5fd73059fca78be0b..c8d36c1da4e3bca8020187131ca09f5196902836 100644
(file)
--- a/
general/atomfeed
+++ b/
general/atomfeed
@@
-4,8
+4,8
@@
# UTC and <modified> fixes for 0.3: Frank Hecker
# Enclosures support: Dave Slusher and Keith Irwin
# Upgrade to Atom 1.0 spec: Sam Pearson
# UTC and <modified> fixes for 0.3: Frank Hecker
# Enclosures support: Dave Slusher and Keith Irwin
# Upgrade to Atom 1.0 spec: Sam Pearson
-# Re
place $feed_url with $path_info_full
: Gavin Carr
-# Version: 2007-12-
17
+# Re
moved static $feed_url, added georss support
: Gavin Carr
+# Version: 2007-12-
31
# Docs: Included below: type "perldoc atomfeed", or scroll down
# Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
# Docs: Included below: type "perldoc atomfeed", or scroll down
# Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
@@
-101,6
+101,7
@@
use vars qw/$feed_utc_date/;
$category;
$links;
$summary;
$category;
$links;
$summary;
+$georss;
# ----- plugin subroutines -----
# ----- plugin subroutines -----
@@
-170,10
+171,17
@@
sub story {
use File::stat;
# set up <category>:
use File::stat;
# set up <category>:
+ $category = '';
if ( $path ) {
$category = "<category term=\"$path\"/>";
}
if ( $path ) {
$category = "<category term=\"$path\"/>";
}
+ # GeoRSS support
+ $georss = '';
+ if ($blosxom::plugins{geo} && $geo::latitude && $geo::longitude) {
+ $georss = qq(<georss:point>$geo::latitude $geo::longitude</georss:point>);
+ }
+
# <published>: derive from %blosxom::files
my @published_utc = gmtime($blosxom::files{"$blosxom::datadir$path/$filename.$blosxom::file_extension"});
$published_utc_date = sprintf("%4d-%02d-%02dT%02d:%02d:00Z",
# <published>: derive from %blosxom::files
my @published_utc = gmtime($blosxom::files{"$blosxom::datadir$path/$filename.$blosxom::file_extension"});
$published_utc_date = sprintf("%4d-%02d-%02dT%02d:%02d:00Z",
@@
-260,7
+268,7
@@
sub story {
# Parse the post body:
($body_type, $body) = _parse_markup($$body_ref);
# Parse the post body:
($body_type, $body) = _parse_markup($$body_ref);
- 1;
+
return
1;
}
sub foot {
}
sub foot {
@@
-366,7
+374,16
@@
sub _load_templates {
my $path_info_full = $blosxom::path_info_full || "$blosxom::path_info/index.atom";
$blosxom::template{'atom'}{'head'} =<<HEAD;
<?xml version="1.0" encoding="utf-8"?>\$atomfeed::css_url
my $path_info_full = $blosxom::path_info_full || "$blosxom::path_info/index.atom";
$blosxom::template{'atom'}{'head'} =<<HEAD;
<?xml version="1.0" encoding="utf-8"?>\$atomfeed::css_url
-<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://\$atomfeed::id_domain">
+<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://\$atomfeed::id_domain"
+HEAD
+
+ if ($blosxom::plugins{geo}) {
+ $blosxom::template{'atom'}{'head'} .=
+ qq( xmlns:georss="http://www.georss.org/georss");
+ }
+
+ $blosxom::template{'atom'}{'head'} .= <<HEAD;
+>
<title type="\$atomfeed::blog_title_type">\$atomfeed::blog_title</title>
<subtitle type="\$atomfeed::blog_description_type">\$atomfeed::blog_description</subtitle>
<link rel="self" type="application/atom+xml" href="$blosxom::url$path_info_full" />
<title type="\$atomfeed::blog_title_type">\$atomfeed::blog_title</title>
<subtitle type="\$atomfeed::blog_description_type">\$atomfeed::blog_description</subtitle>
<link rel="self" type="application/atom+xml" href="$blosxom::url$path_info_full" />
@@
-386,7
+403,7
@@
HEAD
<title type="$atomfeed::title_type">$atomfeed::title</title>
<published>$atomfeed::published_utc_date</published>
<updated>$atomfeed::updated_utc_date</updated>
<title type="$atomfeed::title_type">$atomfeed::title</title>
<published>$atomfeed::published_utc_date</published>
<updated>$atomfeed::updated_utc_date</updated>
- $atomfeed::category
+ $atomfeed::category
$atomfeed::georss
<author>
<name>$atomfeed::author</name>
$atomfeed::author_uri$atomfeed::author_email
<author>
<name>$atomfeed::author</name>
$atomfeed::author_uri$atomfeed::author_email