from calibre.web.feeds.news import BasicNewsRecipe


class PilotOnline(BasicNewsRecipe):
    title = u'Pilot Online'
    language = 'en'
    __author__ = 'Krittika Goyal'
    oldest_article = 120  # days
    max_articles_per_feed = 25

    no_stylesheets = True
    remove_tags_before = dict(name='div', attrs={'id': 'wrapper'})
    # remove_tags_after  = dict(name='td', attrs={'class':'asset-bar'})
    remove_tags = [
        dict(name='iframe'),
        dict(name='div', attrs={'class': ['breadcrumb', 'asset-bar', 'footerLogos', 'footerLinks', 'lefty',
                                          'righty', 'last', 'subFooter', 'footerLinks-last', 'comment clear-block', 'box', 'related', ]}),
        dict(name='div', attrs={'id': ['rightColumn']}),
        dict(name='span', attrs={'class': 'comment_forbidden'}),
        dict(name='ul', attrs={'class': 'links inline'}),
        dict(name='p', attrs={'id': 'commentadvisory'}),
        dict(name='div', attrs={
            'style': ['width: 300px; margin-right: 2em; float: left;']}),
        dict(name='div', style="float:right; width: 300px;"),
        dict(name='p', style="clear:both;"),
        dict(name='span', text=':'),
    ]

    feeds = [
        ('Hampton Roads',
         'http://hamptonroads.com/taxterm/11'),
        'http://hamptonroads.com/taxterm/12',
        'http://hamptonroads.com/taxterm/222',
        'http://hamptonroads.com/taxterm/224',
        'http://hamptonroads.com/taxterm/226',
        'http://hamptonroads.com/taxterm/3',
        'http://hamptonroads.com/taxterm/149',
        'http://hamptonroads.com/taxterm/228',
        'http://hamptonroads.com/taxterm/4',
        'http://hamptonroads.com/taxterm/522',
        'http://hamptonroads.com/taxterm/420',
        'http://hamptonroads.com/taxterm/227',
        'http://hamptonroads.com/taxterm/231',
        'http://hamptonroads.com/taxterm/232',
    ]
