calibre/recipes/cumhuriyet.recipe
2023-11-02 14:11:50 +03: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'
__author__ = 'ims'
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'}
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'),
]