#!/usr/bin/env python
__license__ = 'GPL v3'
__author__ = 'Gabriele Marini'
__copyright__ = 'Gabriele Marini'
__description__ = 'Punto Informatico'

'''
http://www.punto-informatico.it/
'''

from calibre.web.feeds.news import BasicNewsRecipe


class PuntoInformatico(BasicNewsRecipe):
    __author__ = 'Gabriele Marini'
    description = 'Punto Informatico: Internet dal 1996'

    cover_url = 'http://punto-informatico.it/images/logo_8bit.png'
    title = 'Punto Informatico '
    publisher = 'italiaNews High Tech'
    category = 'News, Information Tecnology'

    language = 'it'
    timefmt = '[%a, %d %b, %Y]'

    oldest_article = 15
    max_articles_per_feed = 50
    use_embedded_content = False

    remove_javascript = True
    no_stylesheets = True
    keep_only_tags = [dict(name='div', attrs={'class': 'box'})]
    remove_tags = [dict(name='div', attrs={'class': 'boxadv'})]

    def get_article_url(self, article):
        return article.get('id', article.get('guid', None))

    feeds = [('Punto Informatico', 'http://punto-informatico.it/fader/pixml2.xml')]
