mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #4910 (Wired Magazine Cover Story does not show up)
This commit is contained in:
parent
8022663ac3
commit
198ef55095
@ -20,6 +20,7 @@ class Wired(BasicNewsRecipe):
|
|||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
|
masthead_url = 'http://www.wired.com/images/home/wired_logo.gif'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
extra_css = ' body{font-family: sans-serif} .entryDescription li {display: inline; list-style-type: none} '
|
extra_css = ' body{font-family: sans-serif} .entryDescription li {display: inline; list-style-type: none} '
|
||||||
index = 'http://www.wired.com/magazine/'
|
index = 'http://www.wired.com/magazine/'
|
||||||
@ -38,14 +39,34 @@ class Wired(BasicNewsRecipe):
|
|||||||
dict(name=['object','embed','iframe','link'])
|
dict(name=['object','embed','iframe','link'])
|
||||||
,dict(name='div', attrs={'class':['podcast_storyboard','tweetmeme_button']})
|
,dict(name='div', attrs={'class':['podcast_storyboard','tweetmeme_button']})
|
||||||
]
|
]
|
||||||
|
remove_attributes = ['height','width']
|
||||||
|
|
||||||
|
|
||||||
#feeds = [(u'Articles' , u'http://www.wired.com/magazine/feed/' )]
|
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
totalfeeds = []
|
totalfeeds = []
|
||||||
|
|
||||||
soup = self.index_to_soup(self.index)
|
soup = self.index_to_soup(self.index)
|
||||||
|
majorf = soup.find('div',attrs={'class':'index'})
|
||||||
|
if majorf:
|
||||||
|
pfarticles = []
|
||||||
|
firsta = majorf.find(attrs={'class':'spread-header'})
|
||||||
|
if firsta:
|
||||||
|
pfarticles.append({
|
||||||
|
'title' :self.tag_to_string(firsta.a)
|
||||||
|
,'date' :strftime(self.timefmt)
|
||||||
|
,'url' :'http://www.wired.com' + firsta.a['href']
|
||||||
|
,'description':''
|
||||||
|
})
|
||||||
|
for itt in majorf.findAll('li'):
|
||||||
|
itema = itt.find('a',href=True)
|
||||||
|
if itema:
|
||||||
|
pfarticles.append({
|
||||||
|
'title' :self.tag_to_string(itema)
|
||||||
|
,'date' :strftime(self.timefmt)
|
||||||
|
,'url' :'http://www.wired.com' + itema['href']
|
||||||
|
,'description':''
|
||||||
|
})
|
||||||
|
totalfeeds.append(('Cover', pfarticles))
|
||||||
features = soup.find('div',attrs={'id':'my-glider'})
|
features = soup.find('div',attrs={'id':'my-glider'})
|
||||||
if features:
|
if features:
|
||||||
farticles = []
|
farticles = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user