mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Sueddeutsche Zeitung mobil
This commit is contained in:
parent
1110ec56ee
commit
9997d3ad2c
@ -15,7 +15,7 @@ class LiberoNews(BasicNewsRecipe):
|
|||||||
description = 'Italian daily newspaper'
|
description = 'Italian daily newspaper'
|
||||||
|
|
||||||
#cover_url = 'http://www.liberoquotidiano.it/images/Libero%20Quotidiano.jpg'
|
#cover_url = 'http://www.liberoquotidiano.it/images/Libero%20Quotidiano.jpg'
|
||||||
cover_url = 'http://www.edicola.liberoquotidiano.it/vnlibero/fpcut.jsp?testata=milano'
|
cover_url = 'http://www.edicola.liberoquotidiano.it/vnlibero/fpcut.jsp?testata=milano'
|
||||||
title = u'Libero '
|
title = u'Libero '
|
||||||
publisher = 'EDITORIALE LIBERO s.r.l 2006'
|
publisher = 'EDITORIALE LIBERO s.r.l 2006'
|
||||||
category = 'News, politics, culture, economy, general interest'
|
category = 'News, politics, culture, economy, general interest'
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2012, Andreas Zeiser <andreas.zeiser@web.de>'
|
__copyright__ = '2012, 2013 Andreas Zeiser <andreas.zeiser@web.de>'
|
||||||
'''
|
'''
|
||||||
szmobil.sueddeutsche.de/
|
szmobil.sueddeutsche.de/
|
||||||
'''
|
'''
|
||||||
|
# History
|
||||||
|
# 2013.01.09 Fixed bugs in article titles containing "strong" and
|
||||||
|
# other small changes
|
||||||
|
# 2012.08.04 Initial release
|
||||||
|
|
||||||
from calibre import strftime
|
from calibre import strftime
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class SZmobil(BasicNewsRecipe):
|
class SZmobil(BasicNewsRecipe):
|
||||||
title = u'Süddeutsche Zeitung mobil'
|
title = u'Süddeutsche Zeitung mobil'
|
||||||
@ -26,6 +29,8 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
delay = 1
|
delay = 1
|
||||||
cover_source = 'http://www.sueddeutsche.de/verlag'
|
cover_source = 'http://www.sueddeutsche.de/verlag'
|
||||||
|
|
||||||
|
# if you want to get rid of the date on the title page use
|
||||||
|
# timefmt = ''
|
||||||
timefmt = ' [%a, %d %b, %Y]'
|
timefmt = ' [%a, %d %b, %Y]'
|
||||||
|
|
||||||
root_url ='http://szmobil.sueddeutsche.de/'
|
root_url ='http://szmobil.sueddeutsche.de/'
|
||||||
@ -50,7 +55,7 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
|
|
||||||
return browser
|
return browser
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
# find all sections
|
# find all sections
|
||||||
src = self.index_to_soup('http://szmobil.sueddeutsche.de')
|
src = self.index_to_soup('http://szmobil.sueddeutsche.de')
|
||||||
feeds = []
|
feeds = []
|
||||||
@ -76,10 +81,10 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
# first check if link is a special article in section "Meinungsseite"
|
# first check if link is a special article in section "Meinungsseite"
|
||||||
if itt.find('strong')!= None:
|
if itt.find('strong')!= None:
|
||||||
article_name = itt.strong.string
|
article_name = itt.strong.string
|
||||||
article_shorttitle = itt.contents[1]
|
if len(itt.contents)>1:
|
||||||
|
shorttitles[article_id] = itt.contents[1]
|
||||||
|
|
||||||
articles.append( (article_name, article_url, article_id) )
|
articles.append( (article_name, article_url, article_id) )
|
||||||
shorttitles[article_id] = article_shorttitle
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
@ -89,7 +94,7 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
else:
|
else:
|
||||||
article_name = itt.string
|
article_name = itt.string
|
||||||
|
|
||||||
if (article_name[0:10] == " mehr"):
|
if (article_name.find(" mehr") == 0):
|
||||||
# just another link ("mehr") to an article
|
# just another link ("mehr") to an article
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -102,7 +107,9 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
for article_name, article_url, article_id in articles:
|
for article_name, article_url, article_id in articles:
|
||||||
url = self.root_url + article_url
|
url = self.root_url + article_url
|
||||||
title = article_name
|
title = article_name
|
||||||
pubdate = strftime('%a, %d %b')
|
# if you want to get rid of date for each article use
|
||||||
|
# pubdate = strftime('')
|
||||||
|
pubdate = strftime('[%a, %d %b]')
|
||||||
description = ''
|
description = ''
|
||||||
if shorttitles.has_key(article_id):
|
if shorttitles.has_key(article_id):
|
||||||
description = shorttitles[article_id]
|
description = shorttitles[article_id]
|
||||||
@ -115,3 +122,4 @@ class SZmobil(BasicNewsRecipe):
|
|||||||
|
|
||||||
return all_articles
|
return all_articles
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user