Almost-minimal filesystem based blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.3 KiB

#!/usr/bin/perl
use strict;
# You may need to fiddle with this.
use lib 'lib';
use XML::Atom::SimpleFeed;
use Wala;
# Pull in Wala configuration.
our %WalaConf;
do "./p1k3.conf.pl";
$WalaConf{ShowSearchlinks} = 0;
my $w = Wala->new(%WalaConf);
my $scriptname = $w->ScriptName;
print "Content-type: application/atom+xml\n\n";
my $overall_time = $w->iso_date( $w->get_mtime($w->LogFile) );
my $feed = XML::Atom::SimpleFeed->new(
rights => 'Public Domain',
title => $w->TitleString . 'feed',
link => { rel => 'self', href => $w->FeedURL },
author => $w->TitleString,
updated => $overall_time,
id => $scriptname,
);
#my @changes = $w->recent_changes($w->RecentChangesMaxLines);
my @changes = $w->recent_changes(10);
my $last_page;
for my $change (@changes) {
my ($timestamp, $pagename, $author, $description)
= $change =~ m/(\d+) (\S+) (\w+) (.*)$/;
next if ($pagename eq $last_page);
my $change_time = $w->iso_date($timestamp);
$feed->add_entry(
title => $pagename,
link => "$scriptname?$pagename",
id => "$scriptname?$pagename",
updated => $change_time,
content => $w->print_page($pagename),
);
$last_page = $pagename;
}
$feed->print;