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
a633543ead
BIN
resources/images/news/pressthink.png
Normal file
BIN
resources/images/news/pressthink.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 533 B |
61
resources/recipes/pressthink.recipe
Normal file
61
resources/recipes/pressthink.recipe
Normal file
@ -0,0 +1,61 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
pressthink.org
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
class PressThink(BasicNewsRecipe):
|
||||
title = 'PressThink'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Ghost of democracy in the media machine'
|
||||
oldest_article = 60
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf8'
|
||||
publisher = 'Arthur L. Carter Journalism Institute'
|
||||
category = 'news, USA, world, economy, politics, media'
|
||||
language = 'en'
|
||||
publication_type = 'blog'
|
||||
extra_css = """
|
||||
body{ font-family: Helvetica,Arial,sans-serif }
|
||||
img{display: block; margin-bottom: 0.5em}
|
||||
h6{font-size: 1.1em; font-weight: bold}
|
||||
.post-author{font-family: Georgia,serif}
|
||||
.post-title{color: #AB0000}
|
||||
.says{color: gray}
|
||||
.comment {
|
||||
border-bottom: 1px dotted #555555;
|
||||
border-top: 1px dotted #DDDDDD;
|
||||
margin-left: 10px;
|
||||
min-height: 100px;
|
||||
padding: 15px 0 20px;
|
||||
}
|
||||
"""
|
||||
|
||||
conversion_options = {
|
||||
'comments' : description
|
||||
,'tags' : category
|
||||
,'language' : language
|
||||
,'publisher': publisher
|
||||
}
|
||||
|
||||
remove_tags = [dict(name=['form','iframe','embed','object','link','base','table','meta'])]
|
||||
keep_only_tags = [dict(attrs={'class':['post-title','post-author','entry','postmetadata alt','commentlist']})]
|
||||
|
||||
feeds = [(u'Articles', u'http://pressthink.org/feed/')]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
for item in soup.findAll('img', alt=False):
|
||||
item['alt'] = 'image'
|
||||
for alink in soup.findAll('a'):
|
||||
if alink.string is not None:
|
||||
tstr = alink.string
|
||||
alink.replaceWith(tstr)
|
||||
return soup
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user