package DaylightAtheism;

use parent qw(RSS::Tree);
use strict;

use constant {
    NAME  => 'da',
    TITLE => 'Daylight Atheism',
    FEED  => 'http://www.patheos.com/blogs/daylightatheism/feed/',
};


sub render {
    my ($self, $item) = @_;
    my (@body) = grep { my $c = $_->attr('class'); !$c || $c !~ /ad-container/ }
      $item->page->find('//div[%s]//following-sibling::*', 'story-block')
        or return;
    my ($index) = grep { my $c = $body[$_]->attr('class'); $c && $c =~ /social-sharing/ } 0 .. $#body;
    splice @body, $index if defined $index;
    return @body;
}


1;
