#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai

__author__    = 'Darko Spasovski'
__license__   = 'GPL v3'
__copyright__ = '2011, Darko Spasovski <darko.spasovski at gmail.com>'

'''
www.plusinfo.mk
'''
from calibre.web.feeds.news import BasicNewsRecipe

class PlusInfo(BasicNewsRecipe):

    INDEX                 = 'www.plusinfo.mk'
    title                 = u'+info'
    __author__ = 'Darko Spasovski'
    description           = 'Macedonian news portal'
    publication_type      = 'newsportal'
    category              = 'news, Macedonia'
    language              = 'mk'
    masthead_url          = 'http://www.plusinfo.mk/style/images/logo.jpg'
    remove_javascript     = True
    no_stylesheets        = True
    use_embedded_content  = False
    remove_empty_feeds    = True
    oldest_article        = 1
    max_articles_per_feed = 100

    remove_tags = []
    remove_tags.append(dict(name='div', attrs={'class':['komentari_holder', 'objava', 'koment']}))
    remove_tags.append(dict(name='ul', attrs={'class':['vest_meni']}))
    remove_tags.append(dict(name='a', attrs={'name': ['fb_share']}))
    keep_only_tags = [dict(name='div', attrs={'class': 'vest1'})]

    feeds          = [(u'Македонија', u'http://www.plusinfo.mk/rss/makedonija'),
                      (u'Бизнис', u'http://www.plusinfo.mk/rss/biznis'),
                      (u'Скопје', u'http://www.plusinfo.mk/rss/skopje'),
                      (u'Култура', u'http://www.plusinfo.mk/rss/kultura'),
                      (u'Свет', u'http://www.plusinfo.mk/rss/svet'),
                      (u'Сцена', u'http://www.plusinfo.mk/rss/scena'),
                      (u'Здравје', u'http://www.plusinfo.mk/rss/zdravje'),
                      (u'Магазин', u'http://www.plusinfo.mk/rss/magazin'),
                      (u'Спорт', u'http://www.plusinfo.mk/rss/sport')]

    # uncomment the following block if you want the print version (note: it lacks photos)
#    def print_version(self,url):
#        segments = url.split('/')
#        printURL = '/'.join(segments[0:3]) + '/print/' + '/'.join(segments[5:])
#        return printURL
