diff --git a/recipes/atlantic.recipe b/recipes/atlantic.recipe index cc52dfe59e..89cc6284b0 100644 --- a/recipes/atlantic.recipe +++ b/recipes/atlantic.recipe @@ -26,7 +26,7 @@ class TheAtlantic(BasicNewsRecipe): else: title = 'The Atlantic' description = 'Current affairs and politics focussed on the US' - INDEX = 'http://www.theatlantic.com/magazine/' + INDEX = 'https://www.theatlantic.com/magazine/' __author__ = 'Kovid Goyal' language = 'en' @@ -97,24 +97,24 @@ class TheAtlantic(BasicNewsRecipe): use_embedded_content = False feeds = [ - ('The Atlantic', 'http://www.theatlantic.com/feed/all/'), - ('Best of The Atlantic', 'http://www.theatlantic.com/feed/best-of/'), - ('Politics | The Atlantic', 'http://www.theatlantic.com/feed/channel/politics/'), - ('Business | The Atlantic', 'http://www.theatlantic.com/feed/channel/business/'), - ('Culture | The Atlantic', 'http://www.theatlantic.com/feed/channel/entertainment/'), - ('Global | The Atlantic', 'http://www.theatlantic.com/feed/channel/international/'), - ('Technology | The Atlantic', 'http://www.theatlantic.com/feed/channel/technology/'), - ('U.S. | The Atlantic', 'http://www.theatlantic.com/feed/channel/national/'), - ('Health | The Atlantic', 'http://www.theatlantic.com/feed/channel/health/'), - ('Video | The Atlantic', 'http://www.theatlantic.com/feed/channel/video/'), - ('Sexes | The Atlantic', 'http://www.theatlantic.com/feed/channel/sexes/'), - ('Education | The Atlantic', 'http://www.theatlantic.com/feed/channel/education/'), - ('Science | The Atlantic', 'http://www.theatlantic.com/feed/channel/science/'), - ('News | The Atlantic', 'http://www.theatlantic.com/feed/channel/news/'), - ('Press Releases | The Atlantic', 'http://www.theatlantic.com/feed/channel/press-releases/'), - ('Newsletters | The Atlantic', 'http://www.theatlantic.com/feed/channel/newsletters/'), - ('The Atlantic Photo', 'http://feeds.feedburner.com/theatlantic/infocus'), - ('Notes | The Atlantic', 'http://feeds.feedburner.com/TheAtlanticNotes'), + ('The Atlantic', 'https://www.theatlantic.com/feed/all/'), + ('Best of The Atlantic', 'https://www.theatlantic.com/feed/best-of/'), + ('Politics | The Atlantic', 'https://www.theatlantic.com/feed/channel/politics/'), + ('Business | The Atlantic', 'https://www.theatlantic.com/feed/channel/business/'), + ('Culture | The Atlantic', 'https://www.theatlantic.com/feed/channel/entertainment/'), + ('Global | The Atlantic', 'https://www.theatlantic.com/feed/channel/international/'), + ('Technology | The Atlantic', 'https://www.theatlantic.com/feed/channel/technology/'), + ('U.S. | The Atlantic', 'https://www.theatlantic.com/feed/channel/national/'), + ('Health | The Atlantic', 'https://www.theatlantic.com/feed/channel/health/'), + ('Video | The Atlantic', 'https://www.theatlantic.com/feed/channel/video/'), + ('Sexes | The Atlantic', 'https://www.theatlantic.com/feed/channel/sexes/'), + ('Education | The Atlantic', 'https://www.theatlantic.com/feed/channel/education/'), + ('Science | The Atlantic', 'https://www.theatlantic.com/feed/channel/science/'), + ('News | The Atlantic', 'https://www.theatlantic.com/feed/channel/news/'), + ('Press Releases | The Atlantic', 'https://www.theatlantic.com/feed/channel/press-releases/'), + ('Newsletters | The Atlantic', 'https://www.theatlantic.com/feed/channel/newsletters/'), + ('The Atlantic Photo', 'https://feeds.feedburner.com/theatlantic/infocus'), + ('Notes | The Atlantic', 'https://feeds.feedburner.com/TheAtlanticNotes'), ] else: def parse_index(self): @@ -140,9 +140,11 @@ class TheAtlantic(BasicNewsRecipe): elif 'hed' in cls: title = self.tag_to_string(h2) a = h2.findParent('a', href=True) + if a is None: + continue url = a['href'] if url.startswith('/'): - url = 'http://www.theatlantic.com' + url + url = 'https://www.theatlantic.com' + url li = a.findParent( 'li', attrs={'class': lambda x: x and 'article' in x.split()} diff --git a/recipes/atlantic_com.recipe b/recipes/atlantic_com.recipe index e7d9f5f337..8d20db7eee 100644 --- a/recipes/atlantic_com.recipe +++ b/recipes/atlantic_com.recipe @@ -26,7 +26,7 @@ class TheAtlantic(BasicNewsRecipe): else: title = 'The Atlantic' description = 'Current affairs and politics focussed on the US' - INDEX = 'http://www.theatlantic.com/magazine/' + INDEX = 'https://www.theatlantic.com/magazine/' __author__ = 'Kovid Goyal' language = 'en' @@ -97,24 +97,24 @@ class TheAtlantic(BasicNewsRecipe): use_embedded_content = False feeds = [ - ('The Atlantic', 'http://www.theatlantic.com/feed/all/'), - ('Best of The Atlantic', 'http://www.theatlantic.com/feed/best-of/'), - ('Politics | The Atlantic', 'http://www.theatlantic.com/feed/channel/politics/'), - ('Business | The Atlantic', 'http://www.theatlantic.com/feed/channel/business/'), - ('Culture | The Atlantic', 'http://www.theatlantic.com/feed/channel/entertainment/'), - ('Global | The Atlantic', 'http://www.theatlantic.com/feed/channel/international/'), - ('Technology | The Atlantic', 'http://www.theatlantic.com/feed/channel/technology/'), - ('U.S. | The Atlantic', 'http://www.theatlantic.com/feed/channel/national/'), - ('Health | The Atlantic', 'http://www.theatlantic.com/feed/channel/health/'), - ('Video | The Atlantic', 'http://www.theatlantic.com/feed/channel/video/'), - ('Sexes | The Atlantic', 'http://www.theatlantic.com/feed/channel/sexes/'), - ('Education | The Atlantic', 'http://www.theatlantic.com/feed/channel/education/'), - ('Science | The Atlantic', 'http://www.theatlantic.com/feed/channel/science/'), - ('News | The Atlantic', 'http://www.theatlantic.com/feed/channel/news/'), - ('Press Releases | The Atlantic', 'http://www.theatlantic.com/feed/channel/press-releases/'), - ('Newsletters | The Atlantic', 'http://www.theatlantic.com/feed/channel/newsletters/'), - ('The Atlantic Photo', 'http://feeds.feedburner.com/theatlantic/infocus'), - ('Notes | The Atlantic', 'http://feeds.feedburner.com/TheAtlanticNotes'), + ('The Atlantic', 'https://www.theatlantic.com/feed/all/'), + ('Best of The Atlantic', 'https://www.theatlantic.com/feed/best-of/'), + ('Politics | The Atlantic', 'https://www.theatlantic.com/feed/channel/politics/'), + ('Business | The Atlantic', 'https://www.theatlantic.com/feed/channel/business/'), + ('Culture | The Atlantic', 'https://www.theatlantic.com/feed/channel/entertainment/'), + ('Global | The Atlantic', 'https://www.theatlantic.com/feed/channel/international/'), + ('Technology | The Atlantic', 'https://www.theatlantic.com/feed/channel/technology/'), + ('U.S. | The Atlantic', 'https://www.theatlantic.com/feed/channel/national/'), + ('Health | The Atlantic', 'https://www.theatlantic.com/feed/channel/health/'), + ('Video | The Atlantic', 'https://www.theatlantic.com/feed/channel/video/'), + ('Sexes | The Atlantic', 'https://www.theatlantic.com/feed/channel/sexes/'), + ('Education | The Atlantic', 'https://www.theatlantic.com/feed/channel/education/'), + ('Science | The Atlantic', 'https://www.theatlantic.com/feed/channel/science/'), + ('News | The Atlantic', 'https://www.theatlantic.com/feed/channel/news/'), + ('Press Releases | The Atlantic', 'https://www.theatlantic.com/feed/channel/press-releases/'), + ('Newsletters | The Atlantic', 'https://www.theatlantic.com/feed/channel/newsletters/'), + ('The Atlantic Photo', 'https://feeds.feedburner.com/theatlantic/infocus'), + ('Notes | The Atlantic', 'https://feeds.feedburner.com/TheAtlanticNotes'), ] else: def parse_index(self): @@ -140,9 +140,11 @@ class TheAtlantic(BasicNewsRecipe): elif 'hed' in cls: title = self.tag_to_string(h2) a = h2.findParent('a', href=True) + if a is None: + continue url = a['href'] if url.startswith('/'): - url = 'http://www.theatlantic.com' + url + url = 'https://www.theatlantic.com' + url li = a.findParent( 'li', attrs={'class': lambda x: x and 'article' in x.split()}