Skip to content

Instantly share code, notes, and snippets.

@ChrisHardie
Created Jan 10, 2019
Embed
What would you like to do?
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