LoginRegisterCommercial SupportContact Us


POD documentation > Web Protocols > RSS.pm

RSS.pm

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


RSS.pm

All-purpose simple RSS feed generator.

Usage:

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");
    $rss->description("foo");
    $rss->link("http://myfeed.com/";);

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:

    $rss->clear;