calibre/recipes/cumhuriyet.recipe
Kovid Goyal 567040ee1e Perform PEP8 compliance checks on the entire codebase
Some bits of PEP 8 are turned off via setup.cfg
2016-07-29 21:25:17 +05:30

69 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import unicode_literals
# based on a recipe by Darko Miletic
#
# Cumhuriyet Gazetesi'nin köşe yazıları okuyuculara cumhuriyet.com.tr
# adresi üzerinden ücretsiz olarak sunulmaktadır.
# Calibre yazılımıyla kullanılabilen bu reçete Cumhuriyet Gazetesi'nin
# günlük köşe yazılarını hızlıca derleyip e-okuyucunuzda kolayca okunabilir
# hale getirir. Yazıların yayınlanma saati sabah olduğu için reçeteyi
# 7:00-24:00 arasında çizelgelemeniz gerekmektedir.
#
# 2014-02-10: Yenilenmiş Cumhuriyet Gazetesi web sitesine göre değiştirildi.
# 2013-08-28: İlk sürüm
__license__ = 'GPL v3'
__copyright__ = '2012, Sethi Eksi <sethi.eksi at gmail.com>'
'''
cumhuriyet.com.tr
'''
from calibre.web.feeds.news import BasicNewsRecipe
class Cumhuriyet_tr(BasicNewsRecipe):
title = 'Cumhuriyet - Yazarlar'
__author__ = 'Cumhuriyet Gazetesi Yazarları'
description = 'Günlük Cumhuriyet Gazetesi Köşe Yazıları'
publisher = 'Cumhuriyet'
category = 'news, politics, Turkey'
oldest_article = 1
max_articles_per_feed = 150
no_stylesheets = True
encoding = 'utf-8'
use_embedded_content = False
masthead_url = 'http://www.cumhuriyet.com.tr/image/template/Cumhuriyet_logo_300x60px.png'
cover_url = 'http://www.cumhuriyet.com.tr/image/template/Cumhuriyet_logo_300x60px.png'
language = 'tr'
extra_css = """ .name {display: block;width:100%;font-size:120%;}
#article-title {display: block;margin-top: 15px;width:100%;font-size:140%;}
#publish-date {display: block;width:100%;font-size:80%;}
"""
# extra_css = """ @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
# .article_description,body{font-family: Arial,Verdana,Helvetica,sans1,sans-serif}
# """
conversion_options = {
'comment': description, 'tags': category, 'publisher': publisher, 'language': language
}
remove_tags = [dict(attrs={'class': 'links'}), dict(
attrs={'id': 'share-bar'}), dict(attrs={'id': 'font-adjust'})]
remove_tags_before = dict(attrs={'id': 'content'})
remove_tags_after = dict(attrs={'id': 'content'})
feeds = [
(u'Yazarlar', u'http://www.cumhuriyet.com.tr/rss/2')
]
# def print_version(self, url):
# articleid = url.rpartition('hn=')[2]
# return 'http://www.cumhuriyet.com.tr/?hn=' + articleid
def get_masthead_title(self):
return self.title + "(" + self.end_date + ")"
def preprocess_html(self, soup):
return self.adeify_images(soup)