from calibre.web.feeds.news import BasicNewsRecipe


class RTE(BasicNewsRecipe):
    title = 'RTE News'
    oldest_article = 7
    max_articles_per_feed = 100
    __author__ = 'Robin Phillips'
    language = 'en_IE'
    auto_cleanup = True
    auto_cleanup_keep = '//figure[@class="photography gal642 single"]'

    remove_tags = [dict(attrs={'class': ['topAd', 'botad', 'previousNextItem', 'headline', 'footerLinks', 'footernav']})]

    feeds = [
        ('News', 'http://www.rte.ie/rss/news.xml'),
        ('Sport', 'http://www.rte.ie/rss/sport.xml'),
        ('Soccer', 'http://www.rte.ie/rss/soccer.xml'),
        ('GAA', 'http://www.rte.ie/rss/gaa.xml'),
        ('Rugby', 'http://www.rte.ie/rss/rugby.xml'),
        ('Racing', 'http://www.rte.ie/rss/racing.xml'),
        ('Business', 'http://www.rte.ie/rss/business.xml'),
        ('Entertainment', 'http://www.rte.ie/rss/entertainment.xml'),
    ]

    # def print_version(self, url):
    # return url.replace('http://www', 'http://m')
