From 11d9fe6805f56ed0f9465b3e05b0be3a0fcd83f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 9 Oct 2016 21:20:10 +0200 Subject: [PATCH 1/4] recipes: fix tvn24.recipe --- recipes/tvn24.recipe | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/recipes/tvn24.recipe b/recipes/tvn24.recipe index b58687682c..789dda0eda 100644 --- a/recipes/tvn24.recipe +++ b/recipes/tvn24.recipe @@ -9,29 +9,31 @@ class tvn24(BasicNewsRecipe): description = u'Sport, Biznes, Gospodarka, Informacje, Wiadomości Zawsze aktualne wiadomości z Polski i ze świata' category = 'news' language = 'pl' - cover_url = 'http://www.qzdrowiu.pl/Upload/KnowQZdrowiu_PressOffice/TVN24_logo_575702b7-edce-4b6f-a41b-4395f9456f96_ff6d6ccf-528a-4b94-9e61-2fed727aba35.png' # noqa + cover_url = 'http://ncplus.pl/~/media/n/npl/kanaly/logo%20na%20strony%20kanalow/tvn24-630.png' # noqa extra_css = 'ul {list-style: none; padding: 0; margin: 0;} li {float: left;margin: 0 0.15em;}' remove_empty_feeds = True remove_javascript = True no_stylesheets = True keep_only_tags = [ - # dict(name='h1', attrs={'class':'size38 mt20 pb20'}), - dict(name='div', attrs={'class': 'mainContainer'}), - # dict(name='p'), - # dict(attrs={'class':['size18 mt10 mb15', 'bold topicSize1', 'fromUsers content', 'textArticleDefault']}) + dict(name='article',attrs={'class':'mb20'}) ] remove_tags = [ - dict(attrs={'class': ['commentsInfo', 'textSize', 'related newsNews align-right', 'box', 'watchMaterial text', 'related galleryGallery align-center', 'advert block-alignment-right', 'userActions', 'socialBookmarks', 'im yourArticle fl', 'dynamicButton addComment fl', 'innerArticleModule onRight cols externalContent', 'thumbsGallery', 'relatedObject customBlockquote align-right', 'lead', 'mainRightColumn', 'articleDateContainer borderGreyBottom', 'socialMediaContainer onRight loaded', 'quizContent', 'twitter', 'facebook', 'googlePlus', 'share', 'voteResult', 'reportTitleBar bgBlue_v4 mb15', 'innerVideoModule center']}), # noqa - dict(name='article', attrs={'class': [ - 'singleArtPhotoCenter', 'singleArtPhotoRight', 'singleArtPhotoLeft']}), + dict(attrs={'class': ['commentsInfo', 'textSize', 'related newsNews align-right', 'box', 'watchMaterial text', 'related galleryGallery align-center', 'advert block-alignment-right', 'userActions', 'socialBookmarks', 'im yourArticle fl', 'dynamicButton addComment fl', 'thumbsGallery', 'relatedObject customBlockquote align-right', 'lead', 'mainRightColumn', 'articleDateContainer borderGreyBottom', 'socialMediaContainer onRight loaded', 'quizContent', 'twitter', 'facebook', 'googlePlus', 'share', 'voteResult', 'reportTitleBar bgBlue_v4 mb15', 'innerVideoModule center']}), # noqa + dict(name='aside'), + dict(name='figure'), dict(name='section', attrs={ - 'id': ['forum', 'innerArticle', 'quiz toCenter', 'mb20']}), - dict(name='div', attrs={ - 'class': 'socialMediaContainer big p20 mb20 borderGrey loaded'}) + 'id': ['forum', 'innerArticle', 'quiz toCenter', 'mb20']}) ] remove_tags_after = [dict(name='li', attrs={'class': 'share'})] feeds = [(u'Najnowsze', u'http://www.tvn24.pl/najnowsze.xml'), ] + def get_article_url(self, article): + link = article.get('link') + # following websites are linked in aforementioned feeds, but have different layout not compatible with this recipe + banned = ['tvnwarszawa.pl','tvnmeteo.pl','szklokontaktowe.tvn24.pl','tvn24bis.pl'] + if not any(x in link for x in banned): + return link + def preprocess_html(self, soup): for alink in soup.findAll('a'): if alink.string is not None: From 02342d905c84d9220e1dfbd34e4f07292617c74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 9 Oct 2016 21:37:19 +0200 Subject: [PATCH 2/4] recipes: remove ekundelek.pl - no new content since feb. 2015 --- recipes/ekundelek_pl.recipe | 19 ------------------- recipes/icons/ekundelek_pl.png | Bin 456 -> 0 bytes 2 files changed, 19 deletions(-) delete mode 100644 recipes/ekundelek_pl.recipe delete mode 100644 recipes/icons/ekundelek_pl.png diff --git a/recipes/ekundelek_pl.recipe b/recipes/ekundelek_pl.recipe deleted file mode 100644 index 48ed1febab..0000000000 --- a/recipes/ekundelek_pl.recipe +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python2 - -__license__ = 'GPL v3' -__copyright__ = u'2012, Artur Stachecki ' - -from calibre.web.feeds.news import BasicNewsRecipe - - -class swiatczytnikow(BasicNewsRecipe): - title = u'eKundelek' - description = u'Najsympatyczniejszy blog o e-czytnikach Kindle' - language = 'pl' - __author__ = u'Artur Stachecki' - oldest_article = 7 - max_articles_per_feed = 100 - remove_empty_feeds = True - remove_tags = [dict(name='div', attrs={'class': 'feedflare'})] - - feeds = [(u'Wpisy', u'http://feeds.feedburner.com/Ekundelekpl?format=xml')] diff --git a/recipes/icons/ekundelek_pl.png b/recipes/icons/ekundelek_pl.png deleted file mode 100644 index d5a40a5847e0a381e1aeedbc75bf0a616d60c5bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 456 zcmV;(0XP1MP)#uDh z=bZOmsVK{`{r*#HZEb@Ozfy|VT05W5r_(74Q3E>aWwUwTZntq9XIVO#Owu&X^Za_f z61rS2z8CV1XyBgD=W@B6&1PDAt>eL9(6((=Rkz!1wOUaP46hCv*;E8q*A1Za`AiQ< zl8~l;1!@gi+9fRQQ5j`C9#a#i(22Ze;17@_K=yb%jM1af2#=Wf(Sw+vHBAF?Q510; z0TrT9KZp(*OtQqfuEOesH4333Jk>T)-mCB{)>i-#_ zXQzw{f=-fT97US4Ohr^ilEXOy*u00sp)9|tQY`&|-bFvBm5cshL@k0pD!QI^QpjgvDYJ&i4bcE?`nUfBM1z0000 Date: Sun, 9 Oct 2016 22:07:02 +0200 Subject: [PATCH 3/4] recipes: fix eso_pl --- recipes/eso_pl.recipe | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/eso_pl.recipe b/recipes/eso_pl.recipe index db969f9d85..e4e1143c7f 100644 --- a/recipes/eso_pl.recipe +++ b/recipes/eso_pl.recipe @@ -12,7 +12,7 @@ class ESO(BasicNewsRecipe): no_stylesheets = True remove_empty_feeds = True use_embedded_content = False - cover_url = 'https://twimg0-a.akamaihd.net/profile_images/1922519424/eso-twitter-logo.png' + cover_url = 'https://www.eso.org/public/archives/logos/medium/eso-logo-black-outline.jpg' keep_only_tags = [dict(attrs={'class': 'subcl'})] remove_tags = [dict(id='lang_row'), dict( attrs={'class': ['pr_typeid', 'pr_news_feature_link', 'outreach_usage', 'hidden']})] @@ -21,6 +21,9 @@ class ESO(BasicNewsRecipe): (u'Og\u0142oszenia', u'http://www.eso.org/public/poland/announcements/feed/'), (u'Zdj\u0119cie tygodnia', u'http://www.eso.org/public/poland/images/potw/feed/')] + keep_only_tags = [ + dict(name='div',attrs={'class':'col-md-9 left-column'})] + def preprocess_html(self, soup): for a in soup.findAll('a', href=True): if a['href'].startswith('/'): From cc43641c163b7d423d65ea15452c5a097e43ad99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 9 Oct 2016 22:28:31 +0200 Subject: [PATCH 4/4] recipes: remove social media sharing from gry-online.pl --- recipes/gry_online_pl.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gry_online_pl.recipe b/recipes/gry_online_pl.recipe index b49664ca55..56f1e44cb1 100644 --- a/recipes/gry_online_pl.recipe +++ b/recipes/gry_online_pl.recipe @@ -18,7 +18,7 @@ class GryOnlinePl(BasicNewsRecipe): keep_only_tags = [dict(name='div', attrs={'class': [ 'gc660', 'gc660 S013', 'news_endpage_tit', 'news_container', 'news']})] remove_tags = [ - dict({'class': ['nav-social', 'add-info', 'smlb', 'lista lista3 lista-gry', 'S013po', 'S013-npb', 'zm_gfx_cnt_bottom', 'ocen-txt', 'wiecej-txt', 'wiecej-txt2', 'twitter-share-button']})] # noqa + dict({'class': ['nav-social', 'add-info', 'smlb', 'lista lista3 lista-gry', 'S013po', 'S013-npb', 'zm_gfx_cnt_bottom', 'ocen-txt', 'wiecej-txt', 'wiecej-txt2', 'social-for-old-news', 'social-for-old-rec']})] # noqa feeds = [ (u'Newsy', 'http://www.gry-online.pl/rss/news.xml'), ('Teksty', u'http://www.gry-online.pl/rss/teksty.xml')]