$feed->set_feed_name_and_url("Search Results", "search=pub"); $feed->build_mini_feed_for_nodes("rss", @search_results);
my $feed_contents = feeds->make_feed( feed_type => 'rss', feed_listing => 'recent_changes' );
Passes additional arguments through to the underlying Wiki::Toolkit::Feed
my @nodes = $wiki->fetch_me_nodes_I_like(); my $feed_contents = $feed->build_feed_for_nodes("rss", @nodes);
my @nodes = $wiki->search_near_here(); my $feed_contents = $feed->build_mini_feed_for_nodes("rss", @nodes);
my $content_type = $feed->default_content_type("rss");
my $maker = $feed->fetch_maker("rss"); my $feed_contents = maker->node_all_versions(%options);
Will always return something of type Wiki::Toolkit::Feed::Listing
OpenGuides::Feed - generate data feeds for OpenGuides in various formats.
Produces RSS 1.0 and Atom 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.
use Wiki::Toolkit; use OpenGuides::Config; use OpenGuides::Feed; my $wiki = Wiki::Toolkit->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. my %args = ( items => 10, feed_type => 'rss', also_return_timestamp => 1 ); my ($feed_output,$feed_timestamp) = $feed->make_feed( %args ); print "Content-Type: application/rdf+xml\n"; print "Last-Modified: " . $feed_timestamp . "\n\n"; print $feed_output;
my $feed = OpenGuides::Feed->new( wiki => $wiki, config => $config, og_version => '1.0', );
wiki must be a Wiki::Toolkit 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.
wiki
config
og_version
Returns a raw Wiki::Toolkit::Feed::RSS object created with the values you invoked this module with.
Returns a raw Wiki::Toolkit::Feed::Atom object created with the values you invoked this module with.
# Ten most recent changes in RSS format. my %args = ( items => 10, feed_type => 'rss', also_return_timestamp => 1 ); my ($feed_output,$feed_timestamp) = $rdf_writer->make_feed( %args ); print "Content-Type: application/rdf+xml\n"; print "Last-Modified: " . $feed_timestamp . "\n\n"; print $feed_output; print $rdf_writer->make_feed( %args ); # All the changes made by bob in the past week, ignoring minor edits, in Atom. $args{days} = 7; $args{ignore_minor_edits = 1; $args{filter_on_metadata} => { username => "bob" }; $args{also_return_timestamp} => 1; my ($feed_output,$feed_timestamp) = $rdf_writer->make_feed( %args ); print "Content-Type: application/atom+xml\n"; print "Last-Modified: " . $feed_timestamp . "\n\n"; print $feed_output;
Instead of calling this, you should instead pass in the 'also_return_timestamp' option. You will then get back the feed timestamp, along with the feed output.
This method will be removed in future, and currently will only return meaningful values if your arguments relate to recent changes.
print "Last-Modified: " . $feed->feed_timestamp( %args ) . "\n\n";
Returns the timestamp of something in POSIX::strftime style ("Tue, 29 Feb 2000 12:34:56 GMT"). 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.
Wiki::Toolkit, Wiki::Toolkit::Feed::RSS and Wiki::Toolkit::Feed::Atom
http://openguides.org/
The OpenGuides Project (openguides-dev@openguides.org)
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.
Written by Earle Martin, based on the original OpenGuides::RDF by Kake Pugh.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install OpenGuides, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenGuides
CPAN shell
perl -MCPAN -e shell install OpenGuides
For more information on module installation, please visit the detailed CPAN module installation guide.