__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
www.vatican.va/news_services/or/or_quo
'''


from calibre.web.feeds.news import BasicNewsRecipe


class LOsservatoreRomano_it(BasicNewsRecipe):
    title = "L'Osservatore Romano"
    __author__ = 'Darko Miletic'
    description = 'Quiornale quotidiano, politico, religioso del Vaticano'
    publisher = 'La Santa Sede'
    category = 'news, politics, religion, Vatican'
    no_stylesheets = True
    INDEX = 'http://www.vatican.va'
    FEEDPAGE = INDEX + '/news_services/or/or_quo/index.html'
    CONTENTPAGE = INDEX + '/news_services/or/or_quo/text.html'
    use_embedded_content = False
    encoding = 'cp1252'
    language = 'it'
    publication_type = 'newspaper'

    conversion_options = {
        'comment': description, 'tags': category, 'publisher': publisher, 'language': language, 'linearize_tables': True
    }

    def parse_index(self):
        articles = []
        articles.append({
            'title': self.title, 'date': '', 'url': self.CONTENTPAGE, 'description': ''
        })
        return [(self.title, articles)]

    def preprocess_html(self, soup):
        for item in soup.findAll(style=True):
            del item['style']
        return self.adeify_images(soup)
