# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai

from calibre.web.feeds.news import BasicNewsRecipe


class Birgun (BasicNewsRecipe):

    title = u'Birgün Gazetesi'
    __author__ = u'Osman Kaysan'
    oldest_article = 7
    max_articles_per_feed = 150
    use_embedded_content = False
    description = 'Birgun gazatesi haberleri, kose yazarlari'
    publisher = 'Birgün'
    category = 'news,haberler,turkce,gazete,birgun'
    language = 'tr'
    no_stylesheets = True
    publication_type = 'newspaper'

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

    cover_img_url = 'http://www.birgun.net/i/birgun.png'
    masthead_url = 'http://www.birgun.net/i/birgun.png'

    remove_attributes = ['width', 'height']

    remove_tags_before = dict(name='h2', attrs={'class': 'storyHeadline'})
    remove_tags_after = dict(name='tr', attrs={'valign': 'top'})
    remove_tags = [dict(name='div', attrs={'id': 'byLine'}), dict(name='div', attrs={'class': 'toollinks'}), dict(name='div', attrs={
        'class': 'main-lead'}), dict(name='div', attrs={'class': 'addthis_toolbox addthis_default_style'}), dict(name='a', attrs={'class': 'addthis_button'})]

    remove_empty_feeds = True

    feeds = [

    (u'Güncel', u'http://www.birgun.net/actuels.xml'),
    (u'Köşe Yazarları', u'http://www.birgun.net/writer.xml'),
    (u'Politika', u'http://www.birgun.net/politics.xml'),
    (u'Ekonomi', u'http://www.birgun.net/economic.xml'),
    (u'Çalışma Yaşamı', u'http://www.birgun.net/workers.xml'),
    (u'Dünya', u'http://www.birgun.net/worlds.xml'),
    (u'Yaşam', u'http://www.birgun.net/lifes.xml')
    ]
