calibre/recipes/cumhuriyet.recipe
un-pogaz ed2930712d various whitespace (extra-edit)
!partial 'E203,E222,E241,E271,E272'
2025-01-24 11:14:24 +01:00

43 lines
1.5 KiB
Python
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.

from calibre.web.feeds.news import BasicNewsRecipe
class Cumhuriyet(BasicNewsRecipe):
title = 'Cumhuriyet'
description = 'News from Turkey'
language = 'tr'
publisher = 'Cumhuriyet'
oldest_article = 1
max_articles_per_feed = 10
no_stylesheets = True
encoding = 'utf-8'
use_embedded_content = False
timefmt = ' [%d %b %Y]'
ignore_duplicate_articles = {'title', 'url'}
remove_empty_feeds = True
keep_only_tags = [
dict(name='h1', attrs={'class': 'baslik'}),
dict(name='h2', attrs={'class': 'spot'}),
dict(name='div', attrs={'class': 'haberKaynagi'}),
dict(name='div', attrs={'class': 'yayin-tarihi'}),
dict(name='div', attrs={'class': 'haberMetni'}),
]
remove_tags = [
dict(name=['button', 'svg']),
dict(name='ul', attrs={'class': 'breadcrumbs'}),
dict(name='div', attrs={'class': 'google-news'}),
dict(name='div', attrs={'class': 'iliskiliHaberler'}),
]
feeds = [
('Gundem', 'https://www.cumhuriyet.com.tr/rss/9999'),
('Dünya', 'https://www.cumhuriyet.com.tr/rss/4'),
('Türkiye', 'https://www.cumhuriyet.com.tr/rss/3'),
('Ekonomi', 'https://www.cumhuriyet.com.tr/rss/5'),
('Kultur Sanat', 'https://www.cumhuriyet.com.tr/rss/6'),
('Siyaset', 'https://www.cumhuriyet.com.tr/rss/2'),
('Bilim ve Teknoloji', 'https://www.cumhuriyet.com.tr/rss/10'),
('Tarım', 'https://www.cumhuriyet.com.tr/rss/19'),
]