NAME

OpenGuides::Feed - generate data feeds for OpenGuides in various formats.

DESCRIPTION

Produces RSS 1.0 feeds for OpenGuides. Distributed and installed as part of the OpenGuides project, not intended for independent installation. This documentation is probably only useful to OpenGuides developers.

SYNOPSIS

use CGI::Wiki;
use OpenGuides::Config;
use OpenGuides::Feed;

my $wiki = CGI::Wiki->new( ... );
my $config = OpenGuides::Config->new( file => "wiki.conf" );
my $feed = OpenGuides::Feed->new( wiki       => $wiki,
                                  config     => $config,
                                  og_version => '1.0', ); 

# Ten most recent changes in RSS format.
print "Content-Type: application/rdf+xml\n";
print "Last-Modified: " . $self->feed_timestamp( items => 10 ) . "\n\n";
my %args = ( items     => 10,
             feed_type => 'rss', );
print $feed->make_feed( %args );

METHODS

new
my $feed = OpenGuides::Feed->new( wiki       => $wiki,
                                  config     => $config,
                                  og_version => '1.0', ); 

wiki must be a CGI::Wiki object and config must be an OpenGuides::Config object. Both of these arguments are mandatory. og_version is an optional argument specifying the version of OpenGuides for inclusion in the feed.

rss_maker

Returns a raw CGI::Wiki::Plugin::RSS::ModWiki object created with the values you invoked this module with.

make_feed
# Ten most recent changes in RSS format.
print "Content-Type: application/rdf+xml\n";
print "Last-Modified: " . $feed->feed_timestamp( items => 10 ) . "\n\n";
my %args = ( items     => 10,
             feed_type => 'rss', );
print $rdf_writer->make_feed( %args );
feed_timestamp
print "Last-Modified: " . $feed->feed_timestamp( %args ) . "\n\n";

Returns the timestamp of the data feed in POSIX::strftime style ("Tue, 29 Feb 2000 12:34:56 GMT"), which is equivalent to the timestamp of the most recent item in the feed. Takes the same arguments as make_recentchanges_rss(). You will most likely need this to print a Last-Modified HTTP header so user-agents can determine whether they need to reload the feed or not.

SEE ALSO

AUTHOR

The OpenGuides Project (openguides-dev@openguides.org)

COPYRIGHT

Copyright (C) 2003-2006 The OpenGuides Project. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

CREDITS

Written by Earle Martin, based on the original OpenGuides::RDF by Kake Pugh.