#!/usr/bin/env perl
use strict;
use warnings;
use 5.016;
use Feed;
use Feed::Utils;
use Log::Log4perl;

Log::Log4perl::init(\<<'LOG');
log4perl.rootLogger = TRACE, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.stderr = 1
log4perl.appender.Screen.layout = PatternLayout
log4perl.appender.Screen.layout.ConversionPattern = [%d{ISO8601}] (%c) %m{chomp}%n
LOG

set_feed_class(Feed->with_traits(
    'MailDir',
    'FixDateTime',
    'DeDupe',
    'AuthorName',
));

set_feed_args(
    dupe_dsn => 'dbi:SQLite:dbname=dedup.db',
    maildir_base => 'maildir',
);

feeds_from_opml(
    {
        mail_folders => 'Gentoo',
    },
    'http://planet.gentoo.org/opml.xml',
);

feeds(
    {
        mail_folders => 'Fun',
    },
    'http://feeds2.feedburner.com/sydneypadua/yBZX',
    {
        uri=>'http://oglaf.com/feeds/rss/',
        title=>'Oglaf',
    },
);
feed(
    uri=>'http://feeds.gawker.com/io9/full',
    mail_folders => 'Weblogs',
);
