#!/usr/bin/env python
__license__ = 'GPL v3'
__author__ = 'Lorenzo Vigentini'
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
__version__ = 'v1.01'
__date__ = '10, January 2010'
__description__ = 'Italian weekly magazine'

'''
http://www.panorama.it/
'''

from calibre.web.feeds.news import BasicNewsRecipe


class panorama(BasicNewsRecipe):
    __author__ = 'Lorenzo Vigentini, based on Darko Miletic'
    description = 'Italian weekly magazine'

    cover_url = 'http://www.panorama.it/panorama/images/panorama_large.gif'
    title = u'Panorama '
    publisher = 'Mondadori'
    category = 'News, politics, culture, economy, general interest'

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

    oldest_article = 7
    max_articles_per_feed = 100
    use_embedded_content = False
    recursion = 10

    remove_javascript = True

    keep_only_tags = [dict(name='div', attrs={'class': ['post', 'article']})]

    remove_tags = [
        dict(name=['object', 'link']),
        dict(name='div', attrs={
             'class': ['post-meta', 'sharing-tools', 'related', 'comments', 'prev-next']}),
        dict(name='div', attrs={'id': ['related-posts', 'footer']})
    ]

    feeds = [
        (u'Panorama Italia', u'http://blog.panorama.it/italia/feed'),
        (u'Panorama Mondo', u'http://blog.panorama.it/mondo/feed'),
        (u'Panorama Cultura e societa',
         u'http://blog.panorama.it/culturaesocieta/feed'),
        (u'Panorama Hitech e scienza',
         u'http://blog.panorama.it/hitechescienza/feed'),
        (u'Panorama Motori', u'http://blog.panorama.it/autoemoto/feed'),
        (u'Panorama libri', u'http://blog.panorama.it/libri/feed'),
        (u'Panorama Opinioni', u'http://blog.panorama.it/opinioni/feed'),

    ]
