mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Update Der Tagesspiegel
This commit is contained in:
parent
0dbaf01e9e
commit
6e0a0db64d
@ -14,6 +14,7 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
|||||||
language = 'de'
|
language = 'de'
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
|
publication_type = 'newspaper'
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.hcf-overline{color:#990000; font-family:Arial,Helvetica,sans-serif;font-size:xx-small;display:block}
|
.hcf-overline{color:#990000; font-family:Arial,Helvetica,sans-serif;font-size:xx-small;display:block}
|
||||||
@ -33,13 +34,16 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
|||||||
no_javascript = True
|
no_javascript = True
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
remove_tags = [{'class':'hcf-header'}]
|
remove_tags = [{'class':'hcf-header'}, {'class':'hcf-atlas'}, {'class':'hcf-date hcf-separate'}]
|
||||||
|
|
||||||
def print_version(self, url):
|
def print_version(self, url):
|
||||||
url = url.split('/')
|
url = url.split('/')
|
||||||
url[-1] = 'v_print,%s?p='%url[-1]
|
url[-1] = 'v_print,%s?p='%url[-1]
|
||||||
return '/'.join(url)
|
return '/'.join(url)
|
||||||
|
|
||||||
|
def get_masthead_url(self):
|
||||||
|
return 'http://www.tagesspiegel.de/images/tsp_logo/3114/6.png'
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
soup = self.index_to_soup('http://www.tagesspiegel.de/zeitung/')
|
soup = self.index_to_soup('http://www.tagesspiegel.de/zeitung/')
|
||||||
|
|
||||||
@ -51,7 +55,7 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
|||||||
ans = []
|
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', 'hcf-teaser hcf-last']}):
|
||||||
|
|
||||||
if div['class'] == 'hcf-header':
|
if div['class'] == 'hcf-header':
|
||||||
try:
|
try:
|
||||||
@ -61,7 +65,7 @@ class TagesspiegelRSS(BasicNewsRecipe):
|
|||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif div['class'] == 'hcf-teaser' and getattr(div.contents[0],'name','') == 'h2':
|
elif div['class'] in ['hcf-teaser', 'hcf-teaser hcf-last'] and getattr(div.contents[0],'name','') == 'h2':
|
||||||
a = div.find('a', href=True)
|
a = div.find('a', href=True)
|
||||||
if not a:
|
if not a:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user