mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
recipes: fix kosmonauta.net
This commit is contained in:
parent
e7dd6770e7
commit
4b571f1553
@ -10,30 +10,11 @@ class Kosmonauta(BasicNewsRecipe):
|
||||
category = 'astronomy'
|
||||
language = 'pl'
|
||||
cover_url = 'http://bi.gazeta.pl/im/4/10393/z10393414X,Kosmonauta-net.jpg'
|
||||
extra_css = '.thumb-left {float:left; margin-right:5px;} .calibre_navbar {clear: both;}'
|
||||
no_stylesheets = True
|
||||
INDEX = 'http://www.kosmonauta.net'
|
||||
oldest_article = 7
|
||||
no_stylesheets = True
|
||||
remove_javascript = True
|
||||
remove_attributes = ['style']
|
||||
max_articles_per_feed = 100
|
||||
keep_only_tags = [dict(name='div', attrs={'class': 'item-page'})]
|
||||
remove_tags = [dict(attrs={'class': ['article-tools clearfix', 'cedtag', 'nav clearfix',
|
||||
'jwDisqusForm']}), dict(attrs={'alt': ['Poprzednia strona', 'Następna strona']})]
|
||||
remove_tags_after = dict(name='div', attrs={'class': 'cedtag'})
|
||||
feeds = [(u'Kosmonauta.net', u'http://www.kosmonauta.net/?format=feed&type=atom')]
|
||||
feeds = [(u'Kosmonauta.net', u'http://www.kosmonauta.net/feed')]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + '?tmpl=component&print=1&layout=default&page='
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for a in soup.findAll(name='a'):
|
||||
if a.has_key('href'): # noqa
|
||||
href = a['href']
|
||||
if not href.startswith('http'):
|
||||
a['href'] = self.INDEX + href
|
||||
for a in soup.findAll(name='img'):
|
||||
if a.has_key('style') and 'float:' in a['style']: # noqa
|
||||
a['class'] = 'thumb-left'
|
||||
return soup
|
||||
|
Loading…
x
Reference in New Issue
Block a user