mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update The Atlantic
Fixes #1852755 [atlantic.recipe broken](https://bugs.launchpad.net/calibre/+bug/1852755)
This commit is contained in:
parent
f41348a5e1
commit
941e31aa46
@ -26,7 +26,7 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
else:
|
else:
|
||||||
title = 'The Atlantic'
|
title = 'The Atlantic'
|
||||||
description = 'Current affairs and politics focussed on the US'
|
description = 'Current affairs and politics focussed on the US'
|
||||||
INDEX = 'http://www.theatlantic.com/magazine/'
|
INDEX = 'https://www.theatlantic.com/magazine/'
|
||||||
|
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
@ -97,24 +97,24 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
('The Atlantic', 'http://www.theatlantic.com/feed/all/'),
|
('The Atlantic', 'https://www.theatlantic.com/feed/all/'),
|
||||||
('Best of The Atlantic', 'http://www.theatlantic.com/feed/best-of/'),
|
('Best of The Atlantic', 'https://www.theatlantic.com/feed/best-of/'),
|
||||||
('Politics | The Atlantic', 'http://www.theatlantic.com/feed/channel/politics/'),
|
('Politics | The Atlantic', 'https://www.theatlantic.com/feed/channel/politics/'),
|
||||||
('Business | The Atlantic', 'http://www.theatlantic.com/feed/channel/business/'),
|
('Business | The Atlantic', 'https://www.theatlantic.com/feed/channel/business/'),
|
||||||
('Culture | The Atlantic', 'http://www.theatlantic.com/feed/channel/entertainment/'),
|
('Culture | The Atlantic', 'https://www.theatlantic.com/feed/channel/entertainment/'),
|
||||||
('Global | The Atlantic', 'http://www.theatlantic.com/feed/channel/international/'),
|
('Global | The Atlantic', 'https://www.theatlantic.com/feed/channel/international/'),
|
||||||
('Technology | The Atlantic', 'http://www.theatlantic.com/feed/channel/technology/'),
|
('Technology | The Atlantic', 'https://www.theatlantic.com/feed/channel/technology/'),
|
||||||
('U.S. | The Atlantic', 'http://www.theatlantic.com/feed/channel/national/'),
|
('U.S. | The Atlantic', 'https://www.theatlantic.com/feed/channel/national/'),
|
||||||
('Health | The Atlantic', 'http://www.theatlantic.com/feed/channel/health/'),
|
('Health | The Atlantic', 'https://www.theatlantic.com/feed/channel/health/'),
|
||||||
('Video | The Atlantic', 'http://www.theatlantic.com/feed/channel/video/'),
|
('Video | The Atlantic', 'https://www.theatlantic.com/feed/channel/video/'),
|
||||||
('Sexes | The Atlantic', 'http://www.theatlantic.com/feed/channel/sexes/'),
|
('Sexes | The Atlantic', 'https://www.theatlantic.com/feed/channel/sexes/'),
|
||||||
('Education | The Atlantic', 'http://www.theatlantic.com/feed/channel/education/'),
|
('Education | The Atlantic', 'https://www.theatlantic.com/feed/channel/education/'),
|
||||||
('Science | The Atlantic', 'http://www.theatlantic.com/feed/channel/science/'),
|
('Science | The Atlantic', 'https://www.theatlantic.com/feed/channel/science/'),
|
||||||
('News | The Atlantic', 'http://www.theatlantic.com/feed/channel/news/'),
|
('News | The Atlantic', 'https://www.theatlantic.com/feed/channel/news/'),
|
||||||
('Press Releases | The Atlantic', 'http://www.theatlantic.com/feed/channel/press-releases/'),
|
('Press Releases | The Atlantic', 'https://www.theatlantic.com/feed/channel/press-releases/'),
|
||||||
('Newsletters | The Atlantic', 'http://www.theatlantic.com/feed/channel/newsletters/'),
|
('Newsletters | The Atlantic', 'https://www.theatlantic.com/feed/channel/newsletters/'),
|
||||||
('The Atlantic Photo', 'http://feeds.feedburner.com/theatlantic/infocus'),
|
('The Atlantic Photo', 'https://feeds.feedburner.com/theatlantic/infocus'),
|
||||||
('Notes | The Atlantic', 'http://feeds.feedburner.com/TheAtlanticNotes'),
|
('Notes | The Atlantic', 'https://feeds.feedburner.com/TheAtlanticNotes'),
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
@ -140,9 +140,11 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
elif 'hed' in cls:
|
elif 'hed' in cls:
|
||||||
title = self.tag_to_string(h2)
|
title = self.tag_to_string(h2)
|
||||||
a = h2.findParent('a', href=True)
|
a = h2.findParent('a', href=True)
|
||||||
|
if a is None:
|
||||||
|
continue
|
||||||
url = a['href']
|
url = a['href']
|
||||||
if url.startswith('/'):
|
if url.startswith('/'):
|
||||||
url = 'http://www.theatlantic.com' + url
|
url = 'https://www.theatlantic.com' + url
|
||||||
li = a.findParent(
|
li = a.findParent(
|
||||||
'li',
|
'li',
|
||||||
attrs={'class': lambda x: x and 'article' in x.split()}
|
attrs={'class': lambda x: x and 'article' in x.split()}
|
||||||
|
@ -26,7 +26,7 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
else:
|
else:
|
||||||
title = 'The Atlantic'
|
title = 'The Atlantic'
|
||||||
description = 'Current affairs and politics focussed on the US'
|
description = 'Current affairs and politics focussed on the US'
|
||||||
INDEX = 'http://www.theatlantic.com/magazine/'
|
INDEX = 'https://www.theatlantic.com/magazine/'
|
||||||
|
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
@ -97,24 +97,24 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
('The Atlantic', 'http://www.theatlantic.com/feed/all/'),
|
('The Atlantic', 'https://www.theatlantic.com/feed/all/'),
|
||||||
('Best of The Atlantic', 'http://www.theatlantic.com/feed/best-of/'),
|
('Best of The Atlantic', 'https://www.theatlantic.com/feed/best-of/'),
|
||||||
('Politics | The Atlantic', 'http://www.theatlantic.com/feed/channel/politics/'),
|
('Politics | The Atlantic', 'https://www.theatlantic.com/feed/channel/politics/'),
|
||||||
('Business | The Atlantic', 'http://www.theatlantic.com/feed/channel/business/'),
|
('Business | The Atlantic', 'https://www.theatlantic.com/feed/channel/business/'),
|
||||||
('Culture | The Atlantic', 'http://www.theatlantic.com/feed/channel/entertainment/'),
|
('Culture | The Atlantic', 'https://www.theatlantic.com/feed/channel/entertainment/'),
|
||||||
('Global | The Atlantic', 'http://www.theatlantic.com/feed/channel/international/'),
|
('Global | The Atlantic', 'https://www.theatlantic.com/feed/channel/international/'),
|
||||||
('Technology | The Atlantic', 'http://www.theatlantic.com/feed/channel/technology/'),
|
('Technology | The Atlantic', 'https://www.theatlantic.com/feed/channel/technology/'),
|
||||||
('U.S. | The Atlantic', 'http://www.theatlantic.com/feed/channel/national/'),
|
('U.S. | The Atlantic', 'https://www.theatlantic.com/feed/channel/national/'),
|
||||||
('Health | The Atlantic', 'http://www.theatlantic.com/feed/channel/health/'),
|
('Health | The Atlantic', 'https://www.theatlantic.com/feed/channel/health/'),
|
||||||
('Video | The Atlantic', 'http://www.theatlantic.com/feed/channel/video/'),
|
('Video | The Atlantic', 'https://www.theatlantic.com/feed/channel/video/'),
|
||||||
('Sexes | The Atlantic', 'http://www.theatlantic.com/feed/channel/sexes/'),
|
('Sexes | The Atlantic', 'https://www.theatlantic.com/feed/channel/sexes/'),
|
||||||
('Education | The Atlantic', 'http://www.theatlantic.com/feed/channel/education/'),
|
('Education | The Atlantic', 'https://www.theatlantic.com/feed/channel/education/'),
|
||||||
('Science | The Atlantic', 'http://www.theatlantic.com/feed/channel/science/'),
|
('Science | The Atlantic', 'https://www.theatlantic.com/feed/channel/science/'),
|
||||||
('News | The Atlantic', 'http://www.theatlantic.com/feed/channel/news/'),
|
('News | The Atlantic', 'https://www.theatlantic.com/feed/channel/news/'),
|
||||||
('Press Releases | The Atlantic', 'http://www.theatlantic.com/feed/channel/press-releases/'),
|
('Press Releases | The Atlantic', 'https://www.theatlantic.com/feed/channel/press-releases/'),
|
||||||
('Newsletters | The Atlantic', 'http://www.theatlantic.com/feed/channel/newsletters/'),
|
('Newsletters | The Atlantic', 'https://www.theatlantic.com/feed/channel/newsletters/'),
|
||||||
('The Atlantic Photo', 'http://feeds.feedburner.com/theatlantic/infocus'),
|
('The Atlantic Photo', 'https://feeds.feedburner.com/theatlantic/infocus'),
|
||||||
('Notes | The Atlantic', 'http://feeds.feedburner.com/TheAtlanticNotes'),
|
('Notes | The Atlantic', 'https://feeds.feedburner.com/TheAtlanticNotes'),
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
@ -140,9 +140,11 @@ class TheAtlantic(BasicNewsRecipe):
|
|||||||
elif 'hed' in cls:
|
elif 'hed' in cls:
|
||||||
title = self.tag_to_string(h2)
|
title = self.tag_to_string(h2)
|
||||||
a = h2.findParent('a', href=True)
|
a = h2.findParent('a', href=True)
|
||||||
|
if a is None:
|
||||||
|
continue
|
||||||
url = a['href']
|
url = a['href']
|
||||||
if url.startswith('/'):
|
if url.startswith('/'):
|
||||||
url = 'http://www.theatlantic.com' + url
|
url = 'https://www.theatlantic.com' + url
|
||||||
li = a.findParent(
|
li = a.findParent(
|
||||||
'li',
|
'li',
|
||||||
attrs={'class': lambda x: x and 'article' in x.split()}
|
attrs={'class': lambda x: x and 'article' in x.split()}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user