mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
69baad55fc
@ -10,7 +10,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class TagesspiegelRSS(BasicNewsRecipe):
|
||||
title = u'Der Tagesspiegel'
|
||||
__author__ = 'Ingo Paschke'
|
||||
__author__ = 'Ingo Paschke'
|
||||
language = 'de'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
@ -26,7 +26,7 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
||||
.quote .cite{font-family:Georgia,Palatino,Palatino Linotype,FreeSerif,serif;font-size:xx-small}
|
||||
.hcf-inline-left{float:left;margin-right:15px;position:relative;}
|
||||
.hcf-inline-right{float:right;margin-right:15px;position:relative;}
|
||||
.hcf-smart-box{font-family: Arial, Helvetica, sans-serif; font-size: xx-small; margin: 0px 15px 8px 0px; width: 300px;}
|
||||
.hcf-smart-box{font-family: Arial, Helvetica, sans-serif; font-size: xx-small; margin: 0px 15px 8px 0px; width: 300px;}
|
||||
'''
|
||||
|
||||
no_stylesheets = True
|
||||
@ -39,30 +39,30 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
||||
dict(name='link'), dict(name='iframe'),dict(name='style'),dict(name='meta'),dict(name='button'),
|
||||
dict(name='div', attrs={'class':["hcf-jump-to-comments","hcf-clear","hcf-magnify hcf-media-control"] }),
|
||||
dict(name='span', attrs={'class':["hcf-mainsearch",] }),
|
||||
dict(name='ul', attrs={'class':["hcf-tools"]}),
|
||||
dict(name='ul', attrs={'class': re.compile('hcf-services')})
|
||||
dict(name='ul', attrs={'class':["hcf-tools"]}),
|
||||
dict(name='ul', attrs={'class': re.compile('hcf-services')})
|
||||
]
|
||||
|
||||
def parse_index(self):
|
||||
soup = self.index_to_soup('http://www.tagesspiegel.de/zeitung/')
|
||||
|
||||
def feed_title(div):
|
||||
return ''.join(div.findAll(text=True, recursive=False)).strip() if div is not None else None
|
||||
return ''.join(div.findAll(text=True, recursive=False)).strip() if div is not None else None
|
||||
|
||||
articles = {}
|
||||
key = None
|
||||
ans = []
|
||||
maincol = soup.find('div', attrs={'class':re.compile('hcf-main-col')})
|
||||
maincol = soup.find('div', attrs={'class':re.compile('hcf-main-col')})
|
||||
|
||||
for div in maincol.findAll(True, attrs={'class':['hcf-teaser', 'hcf-header', 'story headline']}):
|
||||
for div in maincol.findAll(True, attrs={'class':['hcf-teaser', 'hcf-header', 'story headline']}):
|
||||
|
||||
if div['class'] == 'hcf-header':
|
||||
try:
|
||||
key = string.capwords(feed_title(div.em.a))
|
||||
articles[key] = []
|
||||
ans.append(key)
|
||||
except:
|
||||
continue
|
||||
try:
|
||||
key = string.capwords(feed_title(div.em.a))
|
||||
articles[key] = []
|
||||
ans.append(key)
|
||||
except:
|
||||
continue
|
||||
|
||||
elif div['class'] == 'hcf-teaser' and getattr(div.contents[0],'name','') == 'h2':
|
||||
a = div.find('a', href=True)
|
||||
@ -88,5 +88,3 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
||||
ans = [(key, articles[key]) for key in ans if articles.has_key(key)]
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
|
@ -10,35 +10,34 @@ from calibre.ebooks.BeautifulSoup import Tag
|
||||
|
||||
class ZeitDe(BasicNewsRecipe):
|
||||
|
||||
title = 'ZEIT Online Reader Edition'
|
||||
title = 'ZEIT Online'
|
||||
description = 'ZEIT Online'
|
||||
language = 'de'
|
||||
lang = 'de_DE'
|
||||
|
||||
__author__ = 'Martin Pitt, Sujata Raman and Ingo Paschke'
|
||||
use_embedded_content = False
|
||||
max_articles_per_feed = 100
|
||||
max_articles_per_feed = 40
|
||||
remove_empty_feeds = True
|
||||
no_stylesheets = True
|
||||
no_javascript = True
|
||||
encoding = 'utf-8'
|
||||
delay = 0
|
||||
|
||||
feeds = [
|
||||
('Seite 1', 'http://newsfeed.zeit.de/index'),
|
||||
('Politik', 'http://www.zeit.de/solr/select/?q=ressort:%22Politik%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Wirtschaft', 'http://www.zeit.de/solr/select/?q=ressort:%22Wirtschaft%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Meinung', 'http://www.zeit.de/solr/select/?q=ressort:%22Meinung%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Gesellschaft', 'http://www.zeit.de/solr/select/?q=ressort:%22Gesellschaft%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Kultur', 'http://www.zeit.de/solr/select/?q=ressort:%22Kultur%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Wissen', 'http://www.zeit.de/solr/select/?q=ressort:%22Wissen%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Digital', 'http://www.zeit.de/solr/select/?q=ressort:%22Digital%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Studium', 'http://www.zeit.de/solr/select/?q=ressort:%22Studium%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Karriere', 'http://www.zeit.de/solr/select/?q=ressort:%22Karriere%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Lebensart', 'http://www.zeit.de/solr/select/?q=ressort:%22Lebensart%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Reisen', 'http://www.zeit.de/solr/select/?q=ressort:%22Reisen%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Auto', 'http://www.zeit.de/solr/select/?q=ressort:%22Auto%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Sport', 'http://www.zeit.de/solr/select/?q=ressort:%22Sport%22%20type:article&version=2.2&start=0&rows=50&sort=date-first-released%20desc&indent=on&wt=xslt&tr=solr2rss.xsl'),
|
||||
('Seite 1', 'http://newsfeed.zeit.de/index_xml'),
|
||||
('Politik', 'http://newsfeed.zeit.de/politik/index'),
|
||||
('Wirtschaft', 'http://newsfeed.zeit.de/wirtschaft/index'),
|
||||
('Meinung', 'http://newsfeed.zeit.de/meinung/index'),
|
||||
('Gesellschaft', 'http://newsfeed.zeit.de/gesellschaft/index'),
|
||||
('Kultur', 'http://newsfeed.zeit.de/kultur/index'),
|
||||
('Wissen', 'http://newsfeed.zeit.de/wissen/index'),
|
||||
('Digital', 'http://newsfeed.zeit.de/digital/index'),
|
||||
('Studium', 'http://newsfeed.zeit.de/studium/index'),
|
||||
('Karriere', 'http://newsfeed.zeit.de/karriere/index'),
|
||||
('Lebensart', 'http://newsfeed.zeit.de/lebensart/index'),
|
||||
('Reisen', 'http://newsfeed.zeit.de/reisen/index'),
|
||||
('Auto', 'http://newsfeed.zeit.de/auto/index'),
|
||||
('Sport', 'http://newsfeed.zeit.de/sport/index'),
|
||||
]
|
||||
|
||||
extra_css = '''
|
||||
@ -77,7 +76,7 @@ class ZeitDe(BasicNewsRecipe):
|
||||
ans = article.get('link',None)
|
||||
ans += "?page=all"
|
||||
|
||||
if 'video' in ans or 'quiz' or 'blog.zeit.de/' in ans :
|
||||
if 'video' in ans or 'quiz' in ans :
|
||||
ans = None
|
||||
return ans
|
||||
|
||||
@ -108,3 +107,4 @@ class ZeitDe(BasicNewsRecipe):
|
||||
tools.extract()
|
||||
return soup
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ class Book(MetaInformation):
|
||||
def thumbnail(self):
|
||||
return None
|
||||
|
||||
def smart_update(self, other):
|
||||
def smart_update(self, other, replace_metadata=False):
|
||||
'''
|
||||
Merge the information in C{other} into self. In case of conflicts, the information
|
||||
in C{other} takes precedence, unless the information in C{other} is NULL.
|
||||
|
@ -26,7 +26,7 @@ class NOOK(USBMS):
|
||||
# Ordered list of supported formats
|
||||
FORMATS = ['epub', 'pdb', 'pdf']
|
||||
|
||||
VENDOR_ID = [0x2080]
|
||||
VENDOR_ID = [0x2080, 0x18d1] # 0x18d1 is for softrooted nook
|
||||
PRODUCT_ID = [0x001]
|
||||
BCD = [0x322]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user