From 7b60995fb7b13c0a3486c419bdf92febdf2c9208 Mon Sep 17 00:00:00 2001 From: "ilker m. sitki" Date: Sat, 31 Aug 2024 16:26:37 +0200 Subject: [PATCH] update the recipe 1-) update the rss for all feeds 2-) make h1 and h2 tag smaller a little bit 3-) change the color of h1 to red Changes to be committed: modified: star_gazetesi.recipe --- recipes/star_gazetesi.recipe | 77 ++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/recipes/star_gazetesi.recipe b/recipes/star_gazetesi.recipe index 0825259b50..86a7b9955a 100644 --- a/recipes/star_gazetesi.recipe +++ b/recipes/star_gazetesi.recipe @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from calibre.web.feeds.news import BasicNewsRecipe @@ -8,55 +6,50 @@ class Star (BasicNewsRecipe): title = u'Star Gazetesi' __author__ = u'thomass' description = 'Yeni Türkiye''nin Gazetesi' - oldest_article = 2 - max_articles_per_feed = 100 + oldest_article = 1 + max_articles_per_feed = 10 no_stylesheets = True - encoding = 'utf-8' publisher = 'Star Media Group' category = 'Güncel, Haber, Türkçe' language = 'tr' 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' masthead_url = 'http://www.stargazete.com/starnew/img/starlogo.png' remove_empty_feeds = True + compress_news_images = True - feeds = [ - - - (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'), - - + # 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;}" + 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 - for alink in soup.findAll('a'): - if alink.string is not None: - tstr = alink.string - alink.replaceWith(tstr) - return soup - # def print_version(self, url): - # return url.replace('/', 'http://www.stargazete.com/') + feeds = [ + ("MANSET", "http://www.star.com.tr/rss/mansetler.xml"), + ("GÜNCEL", "http://www.star.com.tr/rss/guncel.xml"), + ("POLİTİKA", "http://www.star.com.tr/rss/politika.xml"), + ("EKONOMİ", "http://www.star.com.tr/rss/ekonomi.xml"), + ("DÜNYA", "http://www.star.com.tr/rss/dunya.xml"), + ("SON DAKİKA", "http://www.star.com.tr/rss/sondakika.xml"), + ("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"), + ]