The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


XML::RSS::Aggregate - RSS Aggregator


    my $rss = XML::RSS::Aggregate->new(
        # parameters for XML::RSS->channel()
        title   => 'Aggregated Examples',
        link    => '',

        # parameters for XML::RSS::Aggregate->aggregate()
        sources => [ qw(
        ) ],
        sort_by => sub {
            $_[0]->{dc}{subject}    # default to sort by dc:date
        uniq_by => sub {
            $_[0]->{title}          # default to uniq by link

    $rss->aggregate( sources => [ ... ] );  # more items


This module implements a subclass of XML::RSS, adding a single aggregate method that fetches other RSS feeds and add to the object itself. It handles the proper ordering and duplication removal for aggregated links.

Also, the constructor new is modified to take arguments to pass implicitly to channel and aggregate methods.

All the base methods are still applicable to this module; please see XML::RSS for details.


aggregate (sources=>\@url, sort_by=>\&func, uniq_by=>\&func)

This method fetches all RSS feeds listed in @url and pass their items to the object's add_item.

The optional sort_by argument specifies the function to use for ordering RSS items; it defaults to sort them by their {dc}{date} attribute (converted to absolute timestamps), with ties broken by their {link} attribute.

The optional uniq_by argument specifies the function to use for removing duplicate RSS items; it defaults to remove items that has the same {link} value.




Autrijus Tang <>


Copyright 2002 by Autrijus Tang <>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.