#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe


def classes(classes):
    q = frozenset(classes.split(' '))
    return dict(
        attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)}
    )

class AdvancedUserRecipe1502348373(BasicNewsRecipe):
    title = 'The Federalist v2'
    oldest_article = 7
    max_articles_per_feed = 100
    no_stylesheets = True
    encoding = 'utf-8'
    use_embedded_content = False
    remove_attributes = ['xmlns', 'lang', 'style', 'width', 'height']

    keep_only_tags = [
        classes('entry-header'),
        classes('wp-post-image byline-month byline-standard alpha-byline entry-content shortbio'),
 
        ]
    remove_tags = [
     classes(
       'post-categories'),
        ]

    feeds = [
        ('All', 'http://thefederalist.com/feed/'),
    ]   