Created
January 10, 2019 20:38
-
-
Save ChrisHardie/68949ed2ccab80cbd8f711c479836bd8 to your computer and use it in GitHub Desktop.
Generate an RSS feed in Perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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