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

Log::Log4perl::init(\<<'LOG');
log4perl.rootLogger = ERROR, 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}] %p{1} (%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_from_opml(
    {
        mail_folders => 'Perl',
    },
    'http://planet.perl.org/opml.xml',
);

feeds_from_opml(
    {
        mail_folders => 'Perl',
    },
    'http://planetsix.perl.org/opml.xml',
);

#feeds_from_opml(
#    {
#        mail_folders => 'Perl',
#    },
#    'http://ironman.enlightenedperl.org/opml',
#);

feeds(
    {
        mail_folders => 'Fun',
    },
    'http://feeds2.feedburner.com/rsspect/fJur',
    'http://feeds2.feedburner.com/sydneypadua/yBZX',
    {
        uri=>'http://oglaf.com/feeds/rss/',
        title=>'Oglaf',
    },
    'http://www.bureau42.com/bureau42.rss',
    'http://syndication.thedailywtf.com/TheDailyWtf',
    'http://thisisindexed.com/feed/',
    'http://notalwaysright.com/feed/atom',
    'http://www.overheardeverywhere.com/index.xml',
    'http://www.overheardinnewyork.com/index.xml',
    'http://www.overheardintheoffice.com/index.xml',
    {
        uri => 'http://bakabt.me/rss.php?uid=714931&pass=94346a8e67f313b3cf64bef311eaf551',
        title => 'BakaBT releases',
    },
);

feeds(
    {
        mail_folders => 'OSS',
    },
    'http://www.alistapart.com/rss.xml',
    'http://feeds.feedburner.com/geek2geek',
    'http://www.groklaw.net/backend/GrokLaw.rdf',
    'http://feeds.feedburner.com/oreilly/radar/atom',
    'http://feeds.feedburner.com/Oreillygmt',
    'http://emacs-fu.blogspot.com/feeds/posts/default',
);

feeds(
    {
        mail_folders => 'Perl',
    },
    'http://www.simon-cozens.org/blogs/simon/feed',
    'http://use.perl.org/~Allison/journal/rss',
    'http://use.perl.org/~chip/journal/rss/',
    'http://use.perl.org/~chip/journal/rss',
    'http://search.cpan.org/uploads.rdf',
    'http://use.perl.org/~jesse/journal/rss',
    'http://use.perl.org/~luqui/journal/rss',
    'http://use.perl.org/~pmichaud/journal/rss',
    'http://pugs.blogs.com/pugs/index.rdf',
    'http://use.perl.org/~Stevan/journal/rss',
    'http://blog.plover.com/index.atom',
    'http://use.perl.org/search.pl?op=journals;content_type=atom',
    'http://blogs.perl.org/atom.xml',
    'http://YAPHB.blogspot.com/atom.xml',
    'http://pugs.blogs.com/audrey/atom.xml',
    'http://blog.fsck.com/atom.xml',
);

feeds(
    {
        mail_folders => 'Science',
    },
    'http://www.slate.com/blogs/bad_astronomy.fulltext.all.10.rss',
    'http://www.badscience.net/?feed=rss2',
    'http://blog.khymos.org/feed/',
    'http://glottorellando.wordpress.com/feed/',
    'http://languagelog.ldc.upenn.edu/nll/?feed=atom',
    'http://scientopia.org/blogs/goodmath/feed/',
    'http://www.illuminatingscience.org/wp-rss2.php',
    'http://www.randi.org/site/index.php?format=feed&type=atom',
    'http://cattaneo-lescienze.blogautore.espresso.repubblica.it/feed/atom/',
    'http://blog.makezine.com/archive/news_from_the_future/index.xml',
    'http://ovadia-lescienze.blogautore.espresso.repubblica.it/feed/atom/',
    'http://www.psygeek.com/?feed=rss2',
    'http://rudimatematici-lescienze.blogautore.espresso.repubblica.it/feed/atom/',
    'http://www.schneier.com/blog/index.rdf',
    'http://bressanini-lescienze.blogautore.espresso.repubblica.it/feed/atom/',
    'http://feeds.feedburner.com/cavolettobruxelles',
    'http://scienceofmagic.wordpress.com/feed/',
);

feeds(
    {
        mail_folders => 'Stuff',
    },
    'http://www.freedom-to-tinker.com/rss.xml?feed=atom',
    'http://us.gizmodo.net/index.xml',
    'http://hackaday.com/feed/',
    'http://watchinghorology.com/feeds/posts/default',
    'http://watchismo.blogspot.com/feeds/posts/default',
);

feeds(
    {
        mail_folders => 'Weblogs',
    },
    'http://allisonrandal.vox.com/library/posts/atom.xml',
    'http://www.axis-of-aevil.org/index.xml',
    'http://www.beppegrillo.it/atom.xml',
    'http://feeds.feedburner.com/boingboing/iBag',
    'http://feeds.feedburner.com/butshesagirl',
    'http://dilbertblog.typepad.com/the_dilbert_blog/index.rdf',
    'http://dilbert.com/blog/entry.feed/',
    'http://duecents.blogspot.com/feeds/posts/default',
    'http://www.anzeledda.it/wp/feed',
    'http://www.haibane.info/feed/',
    'http://syndication.splinder.com/stilgar/atom.xml',
    'http://feeds.gawker.com/io9/full',
    'http://nobodyharks.blogspot.com/feeds/posts/default',
    'http://spaghettovolante.wordpress.com/feed/',
    'http://ziriruzine.blogspot.com/feeds/posts/default',
    'http://www.insolita.ilcannocchiale.it/blogs/feeds/blogatom.aspx?blogid=25491',
    'http://feeds.feedburner.com/malvestite',
    'http://exquisitebeast.tumblr.com/rss',
);

feeds(
    {
        mail_folders => 'Writers',
    },
    'http://scienceinmyfiction.com/feed/',
    'http://www.antipope.org/charlie/blog-static/atom.xml',
    'http://elizabethbear.livejournal.com/data/atom',
    'http://lisagoldresearch.wordpress.com/feed/',
    'http://www.myspace.com/loismcmasterbujold/blog/rss',
    'http://journal.neilgaiman.com/feeds/posts/default',
    'http://www.tor.com/index.php?option=com_content&view=all&format=feed&type=rss&content=frontpage',
    'http://www.thewaythefutureblogs.com/feed/',
    'http://whatever.scalzi.com/feed/',
    'http://www.webcomicsnation.com/rss.php?type=creator&creator=1318',
    'http://caption.org/?q=rss.xml',
    'http://thecomposites.tumblr.com/rss',
);

feeds(
    {
        mail_folders => '3dPrinter',
    },
    'http://hydraraptor.blogspot.com/feeds/posts/default',
    'http://blog.makerbot.com/feed/',
    'http://blog.thingiverse.com/feed/atom/',
);

