Skip to content

Instantly share code, notes, and snippets.

@ChrisHardie
Created January 10, 2019 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisHardie/68949ed2ccab80cbd8f711c479836bd8 to your computer and use it in GitHub Desktop.
Save ChrisHardie/68949ed2ccab80cbd8f711c479836bd8 to your computer and use it in GitHub Desktop.
Generate an RSS feed in Perl
#!/usr/bin/perl
use XML::RSS;
use strict;
my @event_array = <SQL MAGIC GOES HERE>;
my $rss = new XML::RSS;
$rss->channel( title => 'Your Title Here', link => 'https://...',
description => 'Your description here.' );
foreach (@event_array) {
$rss->add_item(
title => 'Item Title',
link => 'https://...',
description => 'Item Content',
);
}
print $rss->as_string;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment