From fa0279ec41b50b08f1edc0520250721d47fdb0a8 Mon Sep 17 00:00:00 2001 From: Kennyl Date: Tue, 24 Jan 2017 14:24:59 +0800 Subject: [PATCH 1/3] Remove Div's style safer than before display:none change to nothing --- recipes/apple_daily.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index 98828bfd56..8ac2c58060 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -253,7 +253,7 @@ class AppleDaily(BasicNewsRecipe): if os.path.exists(last): with open(last, 'rb') as fi: src = fi.read().decode('utf-8') - src = src.replace('height:260px !important;','display:none') #fix flow-player div tag parent + src = src.replace('height:260px !important;','') #fix flow-player div tag parent soup = BeautifulSoup(src) body = soup.find('body') if body is not None: From 14b4fca6f7e360f6bd60e56f7d0108216ec389a1 Mon Sep 17 00:00:00 2001 From: Kennyl Date: Tue, 24 Jan 2017 14:29:28 +0800 Subject: [PATCH 2/3] Improve layout Change Fonts Size --- recipes/apple_daily.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index 8ac2c58060..f5b50eb233 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -35,7 +35,7 @@ class AppleDaily(BasicNewsRecipe): category = 'Chinese, News, Hong Kong' masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/8/86/Apple_Daily_Title.svg' - extra_css = 'img {display: block; margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: 10px; max-height:90%;} h1 {font-size:200%; text-align:left; font-weight:bold;} p[class=video-caption] {font-size:50%; margin-left:auto; margin-right:auto;}' # noqa + extra_css = 'img {display: block; margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: 10px; max-height:90%;} h1 {font-size:125%; text-align:left; font-weight:bold;} p{font-size:90%;} p[class=video-caption] {font-size:50%; margin-left:auto; margin-right:auto;}' # noqa keep_only_tags = [dict(name='div', attrs={'id': 'content-article'})] remove_tags = [dict(name='div', attrs={'class': 'prev-next-btn'}), dict(name='p', attrs={'class': 'next'})] From 8bd631021d1b94b315c640ce651dcd98f17c8817 Mon Sep 17 00:00:00 2001 From: Kennyl Date: Tue, 24 Jan 2017 14:30:36 +0800 Subject: [PATCH 3/3] Add Publication Type publication_type= 'newspaper' --- recipes/apple_daily.recipe | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index f5b50eb233..865b7f8bbf 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -22,6 +22,7 @@ class AppleDaily(BasicNewsRecipe): title = u'蘋果日報 (香港)' __author__ = 'Eddie Lau' publisher = '蘋果日報' + publication_type= 'newspaper' oldest_article = 1 max_articles_per_feed = 100 auto_cleanup = False