import re

from calibre.web.feeds.news import BasicNewsRecipe


class AdvancedUserRecipe1299640653(BasicNewsRecipe):
    title = 'Oakland North'
    oldest_article = 30
    max_articles_per_feed = 100

    language = 'en_US'
    __author__ = 'noah'
    description = 'Oakland North'
    category = 'news'
    no_stylesheets = True

    masthead_url = 'http://oaklandnorth.net/wp-content/themes/oaklandnorth/images/masthead.png'

    keep_only_tags = [dict(name='div', attrs={'class': re.compile(r'\bpost\b(?!-)', re.IGNORECASE)})]

    remove_tags_after = [dict(name='p', attrs={'class': 'post-postscript'})]

    remove_tags = [dict(name='p', attrs={'class': 'post-postscript'})]

    feeds = [('All Headlines', 'http://oaklandnorth.net/feed/')]
