--- ModWiki.pm.bak 2005-04-04 22:37:07.000000000 +0100 +++ ModWiki.pm 2005-04-05 00:22:23.000000000 +0100 @@ -5,7 +5,6 @@ use vars qw( $VERSION ); $VERSION = '0.06'; -use XML::RSS; use Time::Piece; use URI::Escape; use Carp qw( croak ); @@ -78,10 +77,6 @@ C must be a L object. C, and C and C, if supplied, must be coderefs. -B If you try to put ampersands (C<&>) in your URLs then -L will escape them to C<&>, so use semicolons (C<;>) to -separate any CGI parameter pairs instead. - The mandatory arguments are: =over 4 @@ -180,27 +175,27 @@ sub recent_changes { my ($self, %args) = @_; - my $rss = new XML::RSS (version => '1.0'); - - $rss->add_module( - prefix => 'wiki', - uri => 'http://purl.org/rss/1.0/modules/wiki/' - ); - my $time = localtime; my $timestamp = $time->strftime( "%Y-%m-%dT%H:%M:%S" ); - $rss->channel( - title => $self->{site_name}, - link => $self->{recent_changes_link}, - description => $self->{site_description}, - dc => { - date => $timestamp - }, - wiki => { - interwiki => $self->{interwiki_identifier} - } - ); + my $rss = qq{ + + + + +} . $self->{site_name} . qq{ +} . $self->{recent_changes_link} . qq{ +} . $self->{site_description} . qq{ +} . $timestamp . qq{ +} . $self->{interwiki_identifier} . qq{}; + + my (@urls, @items); # If we're not passed any parameters to limit the items returned, # default to 15, which is apparently the modwiki standard. @@ -242,6 +237,8 @@ my $url = $self->{make_node_url}->( $node_name, $version ); + push @urls, qq{ \n}; + my $diff_url = ""; if ( $self->{make_diff_url} ) { $diff_url = $self->{make_diff_url}->( $node_name ); @@ -252,25 +249,38 @@ $history_url = $self->{make_history_url}->( $node_name ); } - $rss->add_item( - title => $node_name, - link => $url, - description => $description, - dc => { - date => $timestamp, - contributor => $author, - }, - wiki => { - status => $status, - importance => $importance, - diff => $diff_url, - version => $version, - history => $history_url - }, - ); - } + my $node_url = $self->{make_node_url}->( $node_name ); - return $rss->as_string; + my $rdf_url = $node_url; + $rdf_url =~ s/\?/\?id=/; + $rdf_url .= ';format=rdf'; + + push @items, qq{ + + $node_name + $url + $description + $timestamp + $author + $status + $importance + $diff_url + $version + $history_url + + +}; + } + + $rss .= qq{ + + +} . join('', @urls) . qq{ + + +} . join('', @items) . "\n\n"; + + return $rss; } =head1 SEE ALSO @@ -296,12 +306,9 @@ =head1 CREDITS -The people on #core on irc.rhizomatic.net gave encouragement and +The people on #swig on irc.freenode.net gave encouragement and useful advice. -I cribbed some of this code from -L - =cut