mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5623 (wired.recipe broken)
This commit is contained in:
parent
59007222ab
commit
73b0b0fca7
@ -16,13 +16,15 @@ class Wired(BasicNewsRecipe):
|
|||||||
publisher = 'Conde Nast Digital'
|
publisher = 'Conde Nast Digital'
|
||||||
category = 'news, games, IT, gadgets'
|
category = 'news, games, IT, gadgets'
|
||||||
oldest_article = 32
|
oldest_article = 32
|
||||||
|
delay = 1
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
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'
|
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} '
|
publication_type = 'magazine'
|
||||||
|
extra_css = ' body{font-family: Arial,Verdana,sans-serif} .entryDescription li {display: inline; list-style-type: none} '
|
||||||
index = 'http://www.wired.com/magazine/'
|
index = 'http://www.wired.com/magazine/'
|
||||||
|
|
||||||
preprocess_regexps = [(re.compile(r'<meta name="Title".*<title>', re.DOTALL|re.IGNORECASE),lambda match: '<title>')]
|
preprocess_regexps = [(re.compile(r'<meta name="Title".*<title>', re.DOTALL|re.IGNORECASE),lambda match: '<title>')]
|
||||||
@ -38,6 +40,8 @@ class Wired(BasicNewsRecipe):
|
|||||||
remove_tags = [
|
remove_tags = [
|
||||||
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']})
|
||||||
|
,dict(attrs={'id':'ff_bottom_nav'})
|
||||||
|
,dict(name='a',attrs={'href':'http://www.wired.com/app'})
|
||||||
]
|
]
|
||||||
remove_attributes = ['height','width']
|
remove_attributes = ['height','width']
|
||||||
|
|
||||||
@ -72,17 +76,18 @@ class Wired(BasicNewsRecipe):
|
|||||||
farticles = []
|
farticles = []
|
||||||
for item in features.findAll('div',attrs={'class':'section'}):
|
for item in features.findAll('div',attrs={'class':'section'}):
|
||||||
divurl = item.find('div',attrs={'class':'feature-header'})
|
divurl = item.find('div',attrs={'class':'feature-header'})
|
||||||
divdesc = item.find('div',attrs={'class':'feature-text'})
|
if divurl:
|
||||||
url = 'http://www.wired.com' + divurl.a['href']
|
divdesc = item.find('div',attrs={'class':'feature-text'})
|
||||||
title = self.tag_to_string(divurl.a)
|
url = 'http://www.wired.com' + divurl.a['href']
|
||||||
description = self.tag_to_string(divdesc)
|
title = self.tag_to_string(divurl.a)
|
||||||
date = strftime(self.timefmt)
|
description = self.tag_to_string(divdesc)
|
||||||
farticles.append({
|
date = strftime(self.timefmt)
|
||||||
'title' :title
|
farticles.append({
|
||||||
,'date' :date
|
'title' :title
|
||||||
,'url' :url
|
,'date' :date
|
||||||
,'description':description
|
,'url' :url
|
||||||
})
|
,'description':description
|
||||||
|
})
|
||||||
totalfeeds.append(('Featured Articles', farticles))
|
totalfeeds.append(('Featured Articles', farticles))
|
||||||
#department feeds
|
#department feeds
|
||||||
departments = ['rants','start','test','play','found']
|
departments = ['rants','start','test','play','found']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user