Wiki::...Reader(3pm)

πŸ“¦
version 1.6 Β· 2 versions
  • 1.6 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.6 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Wiki::Toolkit::Plugin::RSS::Reader β€” bestie, this lil cutie goes and grabs RSS feeds for you so you can drop them right into Wiki::Toolkit nodes πŸ’–


🌸 DESCRIPTION 🌸

Okay so picture this: you've got a wiki, you want a feed living inside a node, and you don't wanna hand-copy headlines like some kind of medieval scribe. Enter this Wiki::Toolkit plugin. It reaches out to a URL you give it, scoops up an RSS feed, and hands it to you ready to be included in a wiki node. Iconic behaviour, no cap. πŸ¦‹


✨ SYNOPSIS ✨

use Wiki::Toolkit::Plugin::RSS::Reader;

my $rss = Wiki::Toolkit::Plugin::RSS::Reader->new(
  url   => 'http://example.com/feed.rss'
);

my @items = $rss->retrieve;

three whole lines and the feed is yours πŸ’…


πŸŽ€ USAGE πŸŽ€

So this is a plugin for Wiki::Toolkit, which is, yk, a toolkit for building wikis. Because of that, please go read the Wiki::Toolkit documentation for the relevant info β€” it's giving "do your homework first" πŸ“šβœ¨

That said… this module can totally be used standalone if you want to. Main character energy, standing on its own two feet 🫢


πŸ’œ METHODS πŸ’œ

new

my $rss = Wiki::Toolkit::Plugin::RSS::Reader->new([options]);

Make a brand new RSS reader, fresh out the box 🎁

The valid options are url or file (and file is a path to an RSS file). Only one of them can be specified β€” pick a lane, bestie, you can't have both 😭

retrieve

my @items = $rss->retrieve;

retrieve hands you back an array of hashes β€” one hash per item in the RSS feed πŸ“ Each one of those hashes contains three things: title, link, and description. That's the whole vibe check βœ…

Now for the part where we're real with each other: if the URL or file you specified can't be retrieved or read, retrieve will return undef instead of blowing up and surprising whoever's reading your wiki. Very demure, very mindful πŸ™ˆ

But if you want the drama? You can set debug to 1 in the options you pass to new, and then the module will croak instead of failing silently. Loud and proud, no secrets πŸ’€πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Earle Martin (EMARTIN@cpan.org) and The Wiki::Toolkit team, (http://www.wiki-toolkit.org/) 🌈


Copyright 2004 Earle Martin. Copyright 2006 the Wiki::Toolkit team.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free as in freedom, slay πŸ•ŠοΈ


okay that's the whole page bestie, go forth and fetch those feeds πŸ’–

This was perl v5.34.0, dated 2022-06-28, and you've been reading Wiki::...Reader(3pm) β€” User Contributed Perl Documentation, mwah πŸ’‹

πŸ“¦ where this page comes from