NAME

App::FeedDeduplicator::Publisher - Publisher class for App::FeedDeduplicator

DESCRIPTION

This module is part of the App::FeedDeduplicator application. It is responsible for publishing the deduplicated entries to a specified format (Atom or JSON).

SYNOPSIS

use App::FeedDeduplicator::Publisher;

my $publisher = App::FeedDeduplicator::Publisher->new(
    entries => $deduplicated_entries,
    format  => 'Atom',
    max_entries => 10,
);

$publisher->publish();

METHODS

new

Creates a new instance of App::FeedDeduplicator::Publisher. The constructor accepts a list of entries, a format (Atom or JSON), and a maximum number of entries as parameters. The entries should be an array reference containing hash references with the keys 'entry' and 'feed'. The 'entry' key should contain an XML::Feed::Entry object, and the 'feed' key should contain a hash reference with the feed information. The format should be either 'Atom' or 'JSON', and the maximum number of entries specifies how many entries to include in the output.

publish

The main method that publishes the deduplicated entries to the specified format (Atom or JSON). It sorts the entries based on their issued, modified, updated, or date attributes and limits the output to the specified maximum number of entries. It generates the output in the specified format and prints it to STDOUT.

AUTHOR

Dave Cross <dave@perlhacks.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2025 Magnum Solutions Ltd. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/artistic.html for more details.