From f1088f4f53a381ca0f6d19eb2e5cec2eacfa3d5c Mon Sep 17 00:00:00 2001 From: Kennyl Date: Mon, 23 Jan 2017 23:38:00 +0800 Subject: [PATCH] New Download Logic Less Hard Code --- recipes/apple_daily.recipe | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index 2a85ff01bc..be0f3b6196 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -105,16 +105,17 @@ class AppleDaily(BasicNewsRecipe): relativea = li.find('a', href=True).get('href', False) a = 'http://hkm.appledaily.com/' + relativea title = li.find('a', text=True).strip() - if (time.tzname != 'HKT'): - if (title == u'三藩市'): - continue - if (title == u'洛杉磯'): - continue - if (title == u'紐  約'): - continue - if (title == u'美  國'): - continue - if (not title == u'動新聞') and (relativea.startswith('list.php')): + # if (time.tzname != 'HKT'): + # if (title == u'三藩市'): + # continue + # if (title == u'洛杉磯'): + # continue + # if (title == u'紐  約'): + # continue + # if (title == u'美  國'): + # continue + # if (not title == u'動新聞') and (relativea.startswith('list.php')): + if (relativea.find('category=daily')!= -1 )and (relativea.startswith('list.php')): sectionList.append((title, a)) for title, url in sectionList: title = title.replace(" ", "")