mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Deutsche Welle by DM. Fixes #7658 (Recipe pack for Deutsche Welle newssite)
This commit is contained in:
parent
be1bd730e2
commit
16a9d973ca
BIN
resources/images/news/deutsche_welle_bs.png
Normal file
BIN
resources/images/news/deutsche_welle_bs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
BIN
resources/images/news/deutsche_welle_en.png
Normal file
BIN
resources/images/news/deutsche_welle_en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
BIN
resources/images/news/deutsche_welle_es.png
Normal file
BIN
resources/images/news/deutsche_welle_es.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
BIN
resources/images/news/deutsche_welle_hr.png
Normal file
BIN
resources/images/news/deutsche_welle_hr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
BIN
resources/images/news/deutsche_welle_pt.png
Normal file
BIN
resources/images/news/deutsche_welle_pt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
BIN
resources/images/news/deutsche_welle_sr.png
Normal file
BIN
resources/images/news/deutsche_welle_sr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 445 B |
76
resources/recipes/deutsche_welle_bs.recipe
Normal file
76
resources/recipes/deutsche_welle_bs.recipe
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_bs(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Vijesti iz Njemacke i svijeta'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'bs'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
@font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
|
||||||
|
body{font-family: Arial,sans1,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Politika' , u'http://rss.dw-world.de/rdf/rss-bos-pol')
|
||||||
|
,(u'Evropa' , u'http://rss.dw-world.de/rdf/rss-bos-eu' )
|
||||||
|
,(u'Kiosk' , u'http://rss.dw-world.de/rdf/rss-bos-eu' )
|
||||||
|
,(u'Ekonomija i Nuka' , u'http://rss.dw-world.de/rdf/rss-bos-eco')
|
||||||
|
,(u'Kultura' , u'http://rss.dw-world.de/rdf/rss-bos-cul')
|
||||||
|
,(u'Sport' , u'http://rss.dw-world.de/rdf/rss-bos-sp' )
|
||||||
|
]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
66
resources/recipes/deutsche_welle_en.recipe
Normal file
66
resources/recipes/deutsche_welle_en.recipe
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_en(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'News from Germany and World'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'en'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
body{font-family: Arial,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [(u'All news', u'http://rss.dw-world.de/rdf/rss-en-all')]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
66
resources/recipes/deutsche_welle_es.recipe
Normal file
66
resources/recipes/deutsche_welle_es.recipe
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_es(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Noticias desde Alemania y mundo'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'es'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
body{font-family: Arial,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [(u'Noticias', u'http://rss.dw-world.de/rdf/rss-sp-all')]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
74
resources/recipes/deutsche_welle_hr.recipe
Normal file
74
resources/recipes/deutsche_welle_hr.recipe
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_hr(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Vesti iz Njemacke i svijeta'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'hr'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
@font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
|
||||||
|
body{font-family: Arial,sans1,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Svijet' , u'http://rss.dw-world.de/rdf/rss-cro-svijet')
|
||||||
|
,(u'Europa' , u'http://rss.dw-world.de/rdf/rss-cro-eu' )
|
||||||
|
,(u'Njemacka' , u'http://rss.dw-world.de/rdf/rss-cro-ger' )
|
||||||
|
,(u'Vijesti' , u'http://rss.dw-world.de/rdf/rss-cro-all' )
|
||||||
|
]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
66
resources/recipes/deutsche_welle_pt.recipe
Normal file
66
resources/recipes/deutsche_welle_pt.recipe
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_pt(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Noticias desde Alemania y mundo'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'pt'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
body{font-family: Arial,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [(u'Noticias', u'http://rss.dw-world.de/rdf/rss-br-all')]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
79
resources/recipes/deutsche_welle_sr.recipe
Normal file
79
resources/recipes/deutsche_welle_sr.recipe
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
dw-world.de
|
||||||
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DeutscheWelle_sr(BasicNewsRecipe):
|
||||||
|
title = 'Deutsche Welle'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Vesti iz Nemacke i sveta'
|
||||||
|
publisher = 'Deutsche Welle'
|
||||||
|
category = 'news, politics, Germany'
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
no_stylesheets = True
|
||||||
|
language = 'sr'
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
remove_empty_feeds = True
|
||||||
|
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||||
|
extra_css = """
|
||||||
|
@font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
|
||||||
|
body{font-family: Arial,sans1,sans-serif}
|
||||||
|
img{margin-top: 0.5em; margin-bottom: 0.2em; display: block}
|
||||||
|
.caption{font-size: x-small; display: block; margin-bottom: 0.4em}
|
||||||
|
"""
|
||||||
|
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||||
|
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher': publisher
|
||||||
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['iframe','embed','object','form','base','meta','link'])
|
||||||
|
,dict(attrs={'class':'actionFooter'})
|
||||||
|
]
|
||||||
|
keep_only_tags=[dict(attrs={'class':'ArticleDetail detail'})]
|
||||||
|
remove_attributes = ['height','width','onclick','border','lang']
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Politika' , u'http://rss.dw-world.de/rdf/rss-ser-pol' )
|
||||||
|
,(u'Srbija' , u'http://rss.dw-world.de/rdf/rss-ser-pol-ser' )
|
||||||
|
,(u'Region' , u'http://rss.dw-world.de/rdf/rss-ser-pol-region' )
|
||||||
|
,(u'Evropa' , u'http://rss.dw-world.de/rdf/rss-ser-pol-eu' )
|
||||||
|
,(u'Nemacka' , u'http://rss.dw-world.de/rdf/rss-ser-pol-ger' )
|
||||||
|
,(u'Svet' , u'http://rss.dw-world.de/rdf/rss-ser-pol-ger' )
|
||||||
|
,(u'Pregled stampe', u'http://rss.dw-world.de/rdf/rss-ser-pol-ger')
|
||||||
|
,(u'Nauka Tehnika Medicina', u'http://rss.dw-world.de/rdf/rss-ser-science')
|
||||||
|
,(u'Kultura' , u'feed:http://rss.dw-world.de/rdf/rss-ser-cul' )
|
||||||
|
]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
artl = url.rpartition('/')[2]
|
||||||
|
return 'http://www.dw-world.de/popups/popup_printcontent/' + artl
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for item in soup.findAll('a'):
|
||||||
|
limg = item.find('img')
|
||||||
|
if item.string is not None:
|
||||||
|
str = item.string
|
||||||
|
item.replaceWith(str)
|
||||||
|
else:
|
||||||
|
if limg:
|
||||||
|
item.name = 'div'
|
||||||
|
del item['href']
|
||||||
|
if item.has_key('target'):
|
||||||
|
del item['target']
|
||||||
|
else:
|
||||||
|
str = self.tag_to_string(item)
|
||||||
|
item.replaceWith(str)
|
||||||
|
return soup
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user