mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix LifeHacker
This commit is contained in:
parent
95ee0429e0
commit
173bce9daa
@ -8,7 +8,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
|
|
||||||
class Lifehacker(BasicNewsRecipe):
|
class Lifehacker(BasicNewsRecipe):
|
||||||
title = 'Lifehacker'
|
title = 'Lifehacker'
|
||||||
__author__ = 'NA'
|
__author__ = 'Kovid Goyal'
|
||||||
description = "Computers make us more productive. Yeah, right. Lifehacker recommends the software downloads and web sites that actually save time. Don't live to geek; geek to live."
|
description = "Computers make us more productive. Yeah, right. Lifehacker recommends the software downloads and web sites that actually save time. Don't live to geek; geek to live."
|
||||||
publisher = 'lifehacker.com'
|
publisher = 'lifehacker.com'
|
||||||
category = 'news, IT, Internet, gadgets, tips and tricks, howto, diy'
|
category = 'news, IT, Internet, gadgets, tips and tricks, howto, diy'
|
||||||
@ -32,14 +32,20 @@ class Lifehacker(BasicNewsRecipe):
|
|||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_attributes = ['width','height']
|
remove_attributes = ['width', 'height', 'style']
|
||||||
keep_only_tags = [dict(attrs={'class':'content permalink'})]
|
|
||||||
remove_tags_before = dict(name='h1')
|
remove_tags_before = dict(name='h1')
|
||||||
remove_tags = [dict(attrs={'class':'contactinfo'})]
|
keep_only_tags = [dict(id='container')]
|
||||||
remove_tags_after = dict(attrs={'class':'contactinfo'})
|
remove_tags_after = dict(attrs={'class':'post-body'})
|
||||||
|
remove_tags = [
|
||||||
|
dict(id="sharemenu"),
|
||||||
|
{'class': 'related'},
|
||||||
|
]
|
||||||
|
|
||||||
feeds = [(u'Articles', u'http://feeds.gawker.com/lifehacker/full')]
|
feeds = [(u'Articles', u'http://feeds.gawker.com/lifehacker/full')]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
return self.adeify_images(soup)
|
return self.adeify_images(soup)
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
return url.replace('#!', '?_escaped_fragment_=')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user