
__license__ = 'GPL v3'
__copyright__ = '2009-2012, Darko Miletic <darko.miletic at gmail.com>'

'''
www.monitor.co.me
'''

import re
from calibre.web.feeds.news import BasicNewsRecipe


class MonitorCG(BasicNewsRecipe):
    title = 'MONITOR online'
    __author__ = 'Darko Miletic'
    description = 'Nezavisni nedjeljnik Monitor'
    publisher = '"Monitor" D.O.O. Podgorica'
    category = 'news, politics, Montenegro'
    oldest_article = 15
    max_articles_per_feed = 150
    no_stylesheets = True
    encoding = 'utf-8'
    auto_cleanup = False
    use_embedded_content = False
    language = 'sr'
    remove_empty_feeds = True
    extra_css             = """
                                @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)}
                                @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
                                h2{font-family: Cambria,"Times New Roman",Times,serif1,serif}
                                body{font-family: Arial,sans1,sans-serif}
                                img{display: block}
                            """

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

    preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
    keep_only_tags = [
        dict(attrs={'class': ['contentheading', 'article-meta', 'article-content']})]
    remove_attributes = ['width', 'height', 'font', 'border', 'align']

    feeds = [

    (u'Danas, Sjutra', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=5&Itemid=27&format=feed&type=rss'),
    (u'Duhankesa', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=13&Itemid=37&format=feed&type=rss'),
    (u'Znaci prepoznavanja', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=6&Itemid=358&format=feed&type=rss'),
    (u'Paralele', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=8&Itemid=359&format=feed&type=rss'),
    (u'Razbijeno ogledalo', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=18&Itemid=354&format=feed&type=rss'),
    (u'Tržište', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=26&Itemid=371&format=feed&type=rss'),
    (u'Feljton', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=29&Itemid=471&format=feed&type=rss'),
    (u'Monitor', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=1&Itemid=1852&format=feed&type=rss'),
    (u'Altervizija', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=31&Itemid=2623&format=feed&type=rss'),
    (u'Fenomeni', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=35&Itemid=3549&format=feed&type=rss'),
    (u'Fokus', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=19&Itemid=252&format=feed&type=rss'),
    (u'Monitoring', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=19&Itemid=252&format=feed&type=rss'),
    (u'Profil', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=21&Itemid=256&format=feed&type=rss'),
    (u'Intervju', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=27&Itemid=404&format=feed&type=rss'),
    (u'Društvo', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=14&Itemid=2&format=feed&type=rss'),
    (u'Region', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=12&Itemid=53&format=feed&type=rss'),
    (u'Svijet', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=11&Itemid=360&format=feed&type=rss'),
    (u'Kultura', u'http://www.monitor.co.me/index.php?option=com_content&view=section&layout=blog&id=9&Itemid=361&format=feed&type=rss')
    ]
