mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix #5742 (Updated recipe for Our Daily Bread)
This commit is contained in:
parent
27a8bbdc37
commit
2727f351d3
BIN
resources/images/news/ourdailybread.png
Normal file
BIN
resources/images/news/ourdailybread.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 739 B |
@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
rbc.org
|
odb.org
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
@ -11,27 +9,29 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
class OurDailyBread(BasicNewsRecipe):
|
class OurDailyBread(BasicNewsRecipe):
|
||||||
title = 'Our Daily Bread'
|
title = 'Our Daily Bread'
|
||||||
__author__ = 'Darko Miletic and Sujata Raman'
|
__author__ = 'Darko Miletic and Sujata Raman'
|
||||||
description = 'Religion'
|
description = "Our Daily Bread is a daily devotional from RBC Ministries which helps readers spend time each day in God's Word."
|
||||||
oldest_article = 15
|
oldest_article = 15
|
||||||
language = 'en'
|
language = 'en'
|
||||||
lang = 'en'
|
|
||||||
|
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
category = 'religion'
|
category = 'ODB, Daily Devotional, Bible, Christian Devotional, Devotional, RBC Ministries, Our Daily Bread, Devotionals, Daily Devotionals, Christian Devotionals, Faith, Bible Study, Bible Studies, Scripture, RBC, religion'
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comments' : description
|
'comments' : description
|
||||||
,'tags' : category
|
,'tags' : category
|
||||||
,'language' : 'en'
|
,'language' : language
|
||||||
|
,'linearize_tables' : True
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':['altbg','text']})]
|
keep_only_tags = [dict(attrs={'class':'module-content'})]
|
||||||
|
remove_tags = [
|
||||||
|
dict(attrs={'id':'article-zoom'})
|
||||||
|
,dict(attrs={'class':'listen-now-box'})
|
||||||
|
]
|
||||||
|
remove_tags_after = dict(attrs={'class':'readable-area'})
|
||||||
|
|
||||||
remove_tags = [dict(name='div', attrs={'id':['ctl00_cphPrimary_pnlBookCover']}),
|
|
||||||
]
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.text{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
.text{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
||||||
.devotionalTitle{font-family:Arial,Helvetica,sans-serif; font-size:large; font-weight: bold;}
|
.devotionalTitle{font-family:Arial,Helvetica,sans-serif; font-size:large; font-weight: bold;}
|
||||||
@ -40,14 +40,9 @@ class OurDailyBread(BasicNewsRecipe):
|
|||||||
a{color:#000000;font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
a{color:#000000;font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
feeds = [(u'Our Daily Bread', u'http://www.rbc.org/rss.ashx?id=50398')]
|
feeds = [(u'Our Daily Bread', u'http://odb.org/feed/')]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
soup.html['xml:lang'] = self.lang
|
|
||||||
soup.html['lang'] = self.lang
|
|
||||||
mtag = '<meta http-equiv="Content-Type" content="text/html; charset=' + self.encoding + '">'
|
|
||||||
soup.head.insert(0,mtag)
|
|
||||||
|
|
||||||
return self.adeify_images(soup)
|
return self.adeify_images(soup)
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
@ -61,3 +56,4 @@ class OurDailyBread(BasicNewsRecipe):
|
|||||||
cover_url = a.img['src']
|
cover_url = a.img['src']
|
||||||
|
|
||||||
return cover_url
|
return cover_url
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user