OpenGuides::Feed(3pm)
π METHODS (the prequel β they literally show up before NAME, don't ask)
okay so before we even get to the NAME section, the page just throws a bunch of methods at you?? slay, chaotic, love that for us. here they are π
πΈ set_feed_name_and_url_params
Overrides the default feed name and the default feed http equivalent url. Super useful on custom feeds, where the defaults are justβ¦ wrong π
$feed->set_feed_name_and_url("Search Results", "search=pub");
$feed->build_mini_feed_for_nodes("rss", @search_results);
πΈ make_feed
Produce one of the standard feeds, in the format you asked for. main character energy fr fr π
my $feed_contents = feeds->make_feed(
feed_type => 'rss',
feed_listing => 'recent_changes'
);
Passes additional arguments through to the underlying Wiki::Toolkit::Feed π«Ά
πΈ build_feed_for_nodes
For the given feed type, build a feed from the supplied list of nodes. It will figure out the feed timestamp from the newest node, and output a last modified header based on this. no cap π
my @nodes = $wiki->fetch_me_nodes_I_like(); my $feed_contents =
$feed->build_feed_for_nodes("rss", @nodes);
πΈ build_mini_feed_for_nodes
For the given feed type, build a mini feed (name and distance, that's it) from the supplied list of nodes. Will figure out the feed timestamp from the newest node, and output a last modified header based on this. same energy, smaller package π
my @nodes = $wiki->search_near_here(); my $feed_contents =
$feed->build_mini_feed_for_nodes("rss", @nodes);
πΈ render_feed_for_nodes
Normally an internal method β it performs the appropriate building of a feed based on a list of nodes. lowkey the stage crew of this module π§
πΈ default_content_type
For the given feed type, return the default content type for that feed.
my $content_type = $feed->default_content_type("rss");
πΈ fetch_maker
For the given feed type, identify and return the maker routine for feeds of that type.
my $maker = $feed->fetch_maker("rss"); my $feed_contents =
maker->node_all_versions(%options);
Will always return something of type Wiki::Toolkit::Feed::Listing β¨
π NAME
OpenGuides::Feed β generate data feeds for OpenGuides in various formats. periodt π
π¦ DESCRIPTION
Produces RSS 1.0 and Atom 1.0 feeds for OpenGuides. It's distributed and installed as part of the OpenGuides project, so it is not intended for independent installation β do not try to make it a solo act bestie, it's a group project π
This documentation is probably only useful to OpenGuides developers. iykyk π
β¨ SYNOPSIS
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;
π METHODS
new
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 β no skipping, no vibes-only shortcut, they're required fr fr π€
og_version is an optional argument specifying the version of OpenGuides for inclusion in the feed. optional but cute π
rss_maker
Returns a raw Wiki::Toolkit::Feed::RSS object created with the values you invoked this module with.
atom_maker
Returns a raw Wiki::Toolkit::Feed::Atom object created with the values you invoked this module with.
make_feed
# 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;
okay bestie yes i know, that $args{ignore_minor_edits = 1; line looks like it lost a brace. that's literally how it's printed in the original manual page, so it stays exactly as-is. not my business, i just work here π
feed_timestamp
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. do that instead, bestie π«Ά
β οΈ heads up: this method will be removed in future, and currently will only return meaningful values if your arguments relate to recent changes. it's giving deprecated, so don't build your whole personality around it π
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. very "so the bots know if anything changed" of it β
π₯ SEE ALSO
Wiki::Toolkit,Wiki::Toolkit::Feed::RSSandWiki::Toolkit::Feed::Atom- <http://openguides.org/>
π AUTHOR
The OpenGuides Project (openguides-dev@lists.openguides.org)
π COPYRIGHT
Copyright (C) 2003-2012 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. slay, free as in freedom π
π CREDITS
Written by Earle Martin, based on the original OpenGuides::RDF by Kake Pugh. icons only, no notes π
and that's the whole page bestie, we ate and left zero crumbs π this was perl v5.32.0, dated 2021-01-30, and yes the header said OpenGuides::Feed(3pm) β obsessed, no cap β¨π
π¦ where this page comes from
- debian bookworm: openguides 0.84-1
- ubuntu jammy: openguides 0.84-1
- ubuntu noble: openguides 0.84-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms