2004-04-12

pubDate in blosxom RSS feeds

The default blosxom installation doesn’t provide a blog entry’s publication date and time. The following blosxom plugin defines the variable $rfctime::rfctime that can be used in your story.rss file like this: <pubDate>$rfctime::rfctime</pubDate>.

# Blosxom Plugin: rfctime
# Author(s): Beat Bolli <bbolli@ewanet.ch>
# Version: 2004-04-12
# Documentation: Provides $rfctime::rfctime, the RFC822-formatted entry 
#   timestamp. Use this in your RSS template to provide the entry's
#   publication date like this:
#
#   <pubDate>$rfctime::rfctime</pubDate>
#

package rfctime;

# --------------------------------

use POSIX 'strftime';

$rfctime = "";


sub start {
  1;
}

sub date {
  my ($pkg, $dir, $date_ref, $timestamp, $dw,$mo,$mo_num,$da,$ti,$yr) = @_;

  my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($timestamp);
  $rfctime = strftime("%a, %d %b %Y %H:%M:00 GMT", $sec, $min, $hour, $mday, $mon, $year, $wday);

  1;
}

1;

23:59 [/software/blog] Google Trackback

Aus aktuellem Anlass

Hier ein Song aus alten natür-Zeiten, der zu Karfreitag und Ostern passt:

«Golgatha», © spätestens 1986 Dominik Häusermann und Adrian Hegnauer. 6166 kB, 256 kbps VBR MP3. Enjoy!

12:35 [/musik] Google Trackback