# -*- coding: utf-8 -*-

from calibre.web.feeds.news import BasicNewsRecipe

class Zaman (BasicNewsRecipe):

    title                  = u'ZAMAN Gazetesi'
    __author__             = u'thomass'
    oldest_article         = 2
    max_articles_per_feed  =100
   # no_stylesheets         = True
    #delay                  = 1
    #use_embedded_content   = False
    encoding               = 'ISO 8859-9'
    publisher              = 'Zaman'
    category               = 'news, haberler,TR,gazete'
    language               = 'tr'
    publication_type = 'newspaper '
    extra_css              = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .introduction{font-weight: bold} .story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} '
    conversion_options = {
                            'tags'            : category
                            ,'language'        : language
                            ,'publisher'       : publisher
                            ,'linearize_tables': False
                         }
    cover_img_url = 'https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/188140_81722291869_2111820_n.jpg'
    masthead_url = 'http://medya.zaman.com.tr/extentions/zaman.com.tr/img/section/logo-section.png'


    keep_only_tags      = [dict(name='div', attrs={'id':[ 'news-detail-content']}), dict(name='td', attrs={'class':['columnist-detail','columnist_head']})  ]
    remove_tags = [ dict(name='div', attrs={'id':['news-detail-news-text-font-size','news-detail-gallery','news-detail-news-bottom-social']}),dict(name='div', attrs={'class':['radioEmbedBg','radyoProgramAdi']}),dict(name='a', attrs={'class':['webkit-html-attribute-value webkit-html-external-link']}),dict(name='table', attrs={'id':['yaziYorumTablosu']}),dict(name='img', attrs={'src':['http://medya.zaman.com.tr/pics/paylas.gif','http://medya.zaman.com.tr/extentions/zaman.com.tr/img/columnist/ma-16.png']})]


    #remove_attributes = ['width','height']
    remove_empty_feeds= True

    feeds          = [
                      ( u'Anasayfa', u'http://www.zaman.com.tr/anasayfa.rss'),
                      ( u'Son Dakika', u'http://www.zaman.com.tr/sondakika.rss'),
                      ( u'En çok Okunanlar', u'http://www.zaman.com.tr/max_all.rss'),
                      ( u'Gündem', u'http://www.zaman.com.tr/gundem.rss'),
                      ( u'Yazarlar', u'http://www.zaman.com.tr/yazarlar.rss'),
                      ( u'Politika', u'http://www.zaman.com.tr/politika.rss'),
                      ( u'Ekonomi', u'http://www.zaman.com.tr/ekonomi.rss'),
                      ( u'Dış Haberler', u'http://www.zaman.com.tr/dishaberler.rss'),
                      ( u'Yorumlar', u'http://www.zaman.com.tr/yorumlar.rss'),
                      ( u'Röportaj', u'http://www.zaman.com.tr/roportaj.rss'),
                      ( u'Spor', u'http://www.zaman.com.tr/spor.rss'),
                      ( u'Kürsü', u'http://www.zaman.com.tr/kursu.rss'),
                      ( u'Kültür Sanat', u'http://www.zaman.com.tr/kultursanat.rss'),
                      ( u'Televizyon', u'http://www.zaman.com.tr/televizyon.rss'),
                      ( u'Manşet', u'http://www.zaman.com.tr/manset.rss'),


                        ]
