mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Merge branch 'master' of https://github.com/t3d/calibre
This commit is contained in:
commit
b409d7b378
@ -12,11 +12,12 @@ class Elektroda(BasicNewsRecipe):
|
|||||||
language = 'pl'
|
language = 'pl'
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_tags_before = dict(name='span', attrs={'class': 'postbody'})
|
|
||||||
remove_tags_after = dict(name='td', attrs={'class': 'spaceRow'})
|
|
||||||
remove_tags = [dict(name='a', attrs={'href': '#top'})]
|
|
||||||
feeds = [(u'Elektroda', u'http://www.elektroda.pl/rtvforum/rss.php')]
|
feeds = [(u'Elektroda', u'http://www.elektroda.pl/rtvforum/rss.php')]
|
||||||
|
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'class': 'title-wrap pull-left'}),
|
||||||
|
dict(name='ul', attrs={'class': 'topic-lists clearfix'})
|
||||||
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
tag = soup.find('span', attrs={'class': 'postbody'})
|
tag = soup.find('span', attrs={'class': 'postbody'})
|
||||||
if tag:
|
if tag:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \
|
__copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \
|
||||||
2013, Tomasz Długosz, tomek3d@gmail.com'
|
2013-2016, Tomasz Długosz, tomek3d@gmail.com'
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
import re
|
import re
|
||||||
@ -51,7 +51,7 @@ class GN(BasicNewsRecipe):
|
|||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
def find_articles(self, main_block):
|
def find_articles(self, main_block):
|
||||||
for a in main_block.findAll('div', attrs={'class': ['prev_doc2', 'sr-document']}):
|
for a in main_block.findAll('div', attrs={'class': ['prev_doc_n1 prev_doc_img21']}):
|
||||||
art = a.find('a')
|
art = a.find('a')
|
||||||
yield {
|
yield {
|
||||||
'title': self.tag_to_string(art),
|
'title': self.tag_to_string(art),
|
||||||
@ -81,8 +81,8 @@ class GN(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='p', attrs={'class': ['r tr', 'l l-2', 'wykop']}),
|
dict(name='p', attrs={'class': ['r tr', 'l l-2', 'wykop', 'l l-2 doc-source']}),
|
||||||
dict(name='div', attrs={'class': ['doc_actions', 'cf', 'fr1_cl']}),
|
dict(name='div', attrs={'class': ['doc_actions', 'cf', 'fr1_cl','txt__social-icons','txt__tags']}),
|
||||||
dict(name='div', attrs={'id': 'vote'}),
|
dict(name='div', attrs={'id': 'vote'}),
|
||||||
dict(name='a', attrs={'class': 'img_enlarge'})
|
dict(name='a', attrs={'class': 'img_enlarge'})
|
||||||
]
|
]
|
||||||
|
@ -10,30 +10,11 @@ class Kosmonauta(BasicNewsRecipe):
|
|||||||
category = 'astronomy'
|
category = 'astronomy'
|
||||||
language = 'pl'
|
language = 'pl'
|
||||||
cover_url = 'http://bi.gazeta.pl/im/4/10393/z10393414X,Kosmonauta-net.jpg'
|
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
|
no_stylesheets = True
|
||||||
INDEX = 'http://www.kosmonauta.net'
|
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
remove_attributes = ['style']
|
remove_attributes = ['style']
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
keep_only_tags = [dict(name='div', attrs={'class': 'item-page'})]
|
feeds = [(u'Kosmonauta.net', u'http://www.kosmonauta.net/feed')]
|
||||||
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')]
|
|
||||||
|
|
||||||
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