LoginRegisterCommercial SupportContact Us

POD documentation > Web Protocols > RSS.pm


RSS feed generation
posted on 3:24 PM, July 12, 2009


All-purpose simple RSS feed generator.


Create the feed (the channel descriptors are accepted without validation, so you must ensure they are correct):

    my $rss = new ExSite::RSS(title=>"My Feed",description=>"foo",link=>"http://myfeed.com/";);

You can also specify channel descriptors separately. This is slightly better, because the parameters are validated and made XML-friendly.

    my $rss = new ExSite::RSS;
    $rss->title("My Feed");

Add items to the feed. The parameters are title, description, link.

    $rss->item("1st Title","1st description","http://myfeed.com/1";);
    $rss->item("2nd Title","2nd description","http://myfeed.com/2";);
    $rss->item("3rd Title","3rd description","http://myfeed.com/3";);

Output the feed:

    print $rss->write;

Clear the feed so you can start over: