Update Jot Down

This commit is contained in:
Kovid Goyal 2015-01-21 08:42:05 +05:30
parent 260d11e79b
commit c31284d713

View File

@ -5,8 +5,8 @@ __license__ = 'GPL v3'
__copyright__ = '23 June 2013, desUBIKado'
__author__ = 'desUBIKado'
__description__ = 'Contemporary Culture Magazine'
__version__ = 'v0.01'
__date__ = '23, June 2013'
__version__ = 'v0.02'
__date__ = '20, January 2015'
'''
http://www.jotdown.es/
'''
@ -34,27 +34,25 @@ class jotdown(BasicNewsRecipe):
(u'Portada', u'http://www.jotdown.es/feed/')
]
keep_only_tags = [dict(name='div', attrs={'class':['single']}),
keep_only_tags = [dict(name='div', attrs={'id':['content']}),
dict(name='div', attrs={'id':['comments']}),
]
remove_tags = [dict(name='a', attrs={'href':['http://alternativaseconomicas.coop/']}),
dict(name='div', attrs={'class':['reply','after-meta','comment-author vcard']}),
dict(name='div', attrs={'class':['reply','after-meta','tags_list','wp_rp_wrap wp_rp_plain','after-meta','share_box']}),
dict(name='div', attrs={'align':['center']}),
dict(name='span', attrs={'class':['fbreplace']}),
dict(name='span', attrs={'class':['fbreplace','says']}),
dict(name='img', attrs={'class':['avatar avatar-60 photo']}),
dict(name='li', attrs={'class':['post pingback']}),
dict(name='div', attrs={'id':'respond'})
]
remove_tags_after = dict(name='div' , attrs={'id':'respond'})
extra_css = '''
.comment-list {font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:12px;}
'''
preprocess_regexps = [
# To present the image of the embedded video
(re.compile(r'<object type="application/x-shockwave-flash" data="http://www.youtube.com/v',
re.DOTALL|re.IGNORECASE), lambda match: '<img src="http://img.youtube.com/vi'),
(re.compile(r'<object type="application/x-shockwave-flash" data="http://www.youtube.com/v', re.DOTALL|re.IGNORECASE),
lambda match: '<img src="http://img.youtube.com/vi'),
(re.compile(r'&rel=0&fs=1"', re.DOTALL|re.IGNORECASE), lambda match: '/0.jpg"><object'),
# To remove the link of the category
(re.compile(r'<div class="meta">', re.DOTALL|re.IGNORECASE), lambda match: '<div class="meta"><!-- '),
@ -62,8 +60,7 @@ class jotdown(BasicNewsRecipe):
(re.compile(r'"category tag">', re.DOTALL|re.IGNORECASE), lambda match: '--> '),
(re.compile(r'</a> &mdash;', re.DOTALL|re.IGNORECASE), lambda match: ''),
# To remove the link of the title
(re.compile(r'<h1> <a href="', re.DOTALL|re.IGNORECASE), lambda match: '<h1> <div class="'),
(re.compile(r'<h1 class="title"><a href="', re.DOTALL|re.IGNORECASE), lambda match: '<h1 class="title"><div class="'),
(re.compile(r'</a></h1>', re.DOTALL|re.IGNORECASE), lambda match: '</div></h1>')
]