This commit is contained in:
Kovid Goyal 2024-08-31 20:27:41 +05:30
commit f51807d9e8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
@ -8,55 +6,50 @@ class Star (BasicNewsRecipe):
title = u'Star Gazetesi' title = u'Star Gazetesi'
__author__ = u'thomass' __author__ = u'thomass'
description = 'Yeni Türkiye''nin Gazetesi' description = 'Yeni Türkiye''nin Gazetesi'
oldest_article = 2 oldest_article = 1
max_articles_per_feed = 100 max_articles_per_feed = 10
no_stylesheets = True no_stylesheets = True
encoding = 'utf-8'
publisher = 'Star Media Group' publisher = 'Star Media Group'
category = 'Güncel, Haber, Türkçe' category = 'Güncel, Haber, Türkçe'
language = 'tr' language = 'tr'
publication_type = 'newspaper' publication_type = 'newspaper'
conversion_options = {
'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': True
}
extra_css = ' .font8{font-weight: bold; font-size:20px}.font11{font-weight: normal; font-size:small}#hdetay{ font-family:sans-serif;font-size: 9px }'
keep_only_tags = [dict(name='div', attrs={'class': ['font8']}), dict(
name='span', attrs={'class': ['font11']}), dict(name='div', attrs={'id': ['hdetay']})]
cover_img_url = 'http://www.stargazete.com/starnew/img/starlogo.png' cover_img_url = 'http://www.stargazete.com/starnew/img/starlogo.png'
masthead_url = 'http://www.stargazete.com/starnew/img/starlogo.png' masthead_url = 'http://www.stargazete.com/starnew/img/starlogo.png'
remove_empty_feeds = True remove_empty_feeds = True
compress_news_images = True
feeds = [ # h1 and h2 tag classes respectively
extra_css = ".title-1 {font-size: 20px; color: #ed0000; text-align: center;}"
extra_css += ".title-2 {font-size: 16px;}"
(u'MANSET', u'http://open.dapper.net/services/starmanset'),
(u'GÜNCEL', u'http://www.stargazete.com/guncel.xml'),
(u'POLİTİKA', u'http://www.stargazete.com/politika.xml'),
(u' EKONOMİ', u'http://www.stargazete.com/ekonomi.xml'),
(u'DÜNYA', u'http://www.stargazete.com/dunya.xml'),
(u'YAZARLAR', u'http://www.stargazete.com/gazeteyazarlar.xml'),
(u'SPOR', u'http://www.stargazete.com/spor.xml'),
(u'SPOR YAZARLARI',
u'http://www.stargazete.com/index.php?metot=rss&islem=sporyazarlar'),
(u'SİNEMA', u'http://www.stargazete.com/sinema.xml'),
(u'KADIN&SAĞLIK', u'http://www.stargazete.com/kadinsaglik.xml'),
(u' STARTEK', u'http://www.stargazete.com/startek.xml'),
(u' AÇIK GÖRÜŞ', u'http://www.stargazete.com/acikgorus.xml'),
(u'Star PAZAR', u'http://www.stargazete.com/pazar.xml'),
(u'Star CUMARTESİ', u'http://www.stargazete.com/cumartesi.xml'),
keep_only_tags = [
dict(name="h1", attrs={"class": "title-1"}),
dict(name="h2", attrs={"class": "title-2"}),
dict(name="div", attrs={"class": "time"}),
dict(name="img", attrs={"class": "margin-bottom-lg"}),
dict(name="div", attrs={"class": "detay"}),
] ]
def preprocess_html(self, soup): # remove links feeds = [
for alink in soup.findAll('a'): ("MANSET", "http://www.star.com.tr/rss/mansetler.xml"),
if alink.string is not None: ("GÜNCEL", "http://www.star.com.tr/rss/guncel.xml"),
tstr = alink.string ("POLİTİKA", "http://www.star.com.tr/rss/politika.xml"),
alink.replaceWith(tstr) ("EKONOMİ", "http://www.star.com.tr/rss/ekonomi.xml"),
return soup ("DÜNYA", "http://www.star.com.tr/rss/dunya.xml"),
# def print_version(self, url): ("SON DAKİKA", "http://www.star.com.tr/rss/sondakika.xml"),
# return url.replace('/', 'http://www.stargazete.com/') ("YAZARLAR", "http://www.star.com.tr/rss/yazarlar.xml"),
("SPOR", "http://www.star.com.tr/rss/spor.xml"),
("SİNEMA", "http://www.star.com.tr/rss/sinema.xml"),
("SANAT", "http://www.star.com.tr/rss/sanat.xml"),
("MAGAZİN", "http://www.star.com.tr/rss/magazin.xml"),
("MEDYA", "http://www.star.com.tr/rss/medya.xml"),
("SAĞLIK", "http://www.star.com.tr/rss/saglik.xml"),
("TEKNOLOJİ", "http://www.star.com.tr/rss/teknoloji.xml"),
("AÇIK GÖRÜŞ", "http://www.star.com.tr/rss/acikgorus.xml"),
("PAZAR", "http://www.star.com.tr/rss/pazar.xml"),
("CUMARTESİ", "http://www.star.com.tr/rss/cumartesi.xml"),
("DİZİ", "http://www.star.com.tr/rss/dizi.xml"),
("ANKARA", "http://www.star.com.tr/rss/ankara.xml"),
("MEMURLAR", "http://www.star.com.tr/rss/memurlar.xml"),
("OTO HAYAT", "http://www.star.com.tr/rss/otohayat.xml"),
]