mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Update Jot Down
This commit is contained in:
parent
da9811c933
commit
949187465d
@ -1,12 +1,10 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
# vim:fileencoding=utf-8
|
__license__ = 'GPL v3'
|
||||||
from __future__ import unicode_literals
|
__copyright__ = '23 June 2013, desUBIKado'
|
||||||
__license__ = 'GPL v3'
|
__author__ = 'desUBIKado'
|
||||||
__copyright__ = '23 June 2013, desUBIKado'
|
|
||||||
__author__ = 'desUBIKado'
|
|
||||||
__description__ = 'Contemporary Culture Magazine'
|
__description__ = 'Contemporary Culture Magazine'
|
||||||
__version__ = 'v0.02'
|
__version__ = 'v0.03'
|
||||||
__date__ = '20, January 2015'
|
__date__ = '28, July 2016'
|
||||||
'''
|
'''
|
||||||
http://www.jotdown.es/
|
http://www.jotdown.es/
|
||||||
'''
|
'''
|
||||||
@ -14,63 +12,54 @@ http://www.jotdown.es/
|
|||||||
import re
|
import re
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
class jotdown(BasicNewsRecipe):
|
class jotdown(BasicNewsRecipe):
|
||||||
author = 'desUBIKado'
|
author = 'desUBIKado'
|
||||||
description = 'Revista digital con magníficos y extensos artículos'
|
description = 'Revista digital con magníficos y extensos artículos'
|
||||||
title = u'Jot Down - Contemporary Culture Magazine'
|
title = u'Jot Down - Contemporary Culture Magazine'
|
||||||
publisher = 'Wabi Sabi Investments, S.C.'
|
publisher = 'Wabi Sabi Investments, S.C.'
|
||||||
category = 'Opinion, culture, science, movies, TV shows, music, blogs'
|
category = 'Opinion, culture, science, movies, TV shows, music, blogs'
|
||||||
language = 'es'
|
language = 'es'
|
||||||
timefmt = '[%a, %d %b, %Y]'
|
timefmt = '[%a, %d %b, %Y]'
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
delay = 1
|
delay = 1
|
||||||
max_articles_per_feed = 20
|
max_articles_per_feed = 20
|
||||||
masthead_url = 'http://www.jotdown.es/wp-content/uploads/2011/04/logoJotDown.png'
|
masthead_url = 'http://www.jotdown.es/wp-content/uploads/2011/04/logoJotDown.png'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Portada', u'http://www.jotdown.es/feed/')
|
(u'Portada', u'http://www.jotdown.es/feed/')
|
||||||
]
|
]
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'id': ['content']}),
|
keep_only_tags = [dict(name='div', attrs={'id':['content']}),
|
||||||
dict(name='div', attrs={'id': ['comments']}),
|
dict(name='div', attrs={'id':['comments']}),
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [dict(name='a', attrs={'href': ['http://alternativaseconomicas.coop/']}),
|
remove_tags = [dict(name='a', attrs={'href':['http://alternativaseconomicas.coop/']}),
|
||||||
dict(name='div', attrs={'class': [
|
dict(name='div', attrs={'class':['reply','after-meta','tags_list','wp_rp_wrap wp_rp_plain','after-meta','share_box']}),
|
||||||
'reply', 'after-meta', 'tags_list', 'wp_rp_wrap wp_rp_plain', 'after-meta', 'share_box']}),
|
dict(name='div', attrs={'align':['center']}),
|
||||||
dict(name='div', attrs={'align': ['center']}),
|
dict(name='span', attrs={'class':['fbreplace','says']}),
|
||||||
dict(name='span', attrs={'class': ['fbreplace', 'says']}),
|
dict(name='img', attrs={'class':['avatar avatar-60 photo']}),
|
||||||
dict(name='img', attrs={
|
dict(name='li', attrs={'class':['post pingback']}),
|
||||||
'class': ['avatar avatar-60 photo']}),
|
dict(name='div', attrs={'id':'respond'})
|
||||||
dict(name='li', attrs={'class': ['post pingback']}),
|
]
|
||||||
dict(name='div', attrs={'id': 'respond'})
|
|
||||||
]
|
|
||||||
|
|
||||||
remove_tags_after = dict(name='div', attrs={'id': 'respond'})
|
remove_tags_after = dict(name='div' , attrs={'id':'respond'})
|
||||||
|
|
||||||
preprocess_regexps = [
|
preprocess_regexps = [
|
||||||
|
# To change the small size of the text
|
||||||
|
(re.compile(r'font-size: small', re.DOTALL|re.IGNORECASE), lambda match: 'font-size: medium'),
|
||||||
# To present the image of the embedded video
|
# 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),
|
(re.compile(r'<object type="application/x-shockwave-flash" data="http://www.youtube.com/v',
|
||||||
lambda match: '<img src="http://img.youtube.com/vi'),
|
re.DOTALL|re.IGNORECASE), lambda match: '<img src="http://img.youtube.com/vi'),
|
||||||
(re.compile(r'&rel=0&fs=1"', re.DOTALL | re.IGNORECASE),
|
(re.compile(r'&rel=0&fs=1"', re.DOTALL|re.IGNORECASE), lambda match: '/0.jpg"><object'),
|
||||||
lambda match: '/0.jpg"><object'),
|
|
||||||
# To remove the link of the category
|
# To remove the link of the category
|
||||||
(re.compile(r'<div class="meta">', re.DOTALL | re.IGNORECASE),
|
(re.compile(r'<div class="meta">', re.DOTALL|re.IGNORECASE), lambda match: '<div class="meta"><!-- '),
|
||||||
lambda match: '<div class="meta"><!-- '),
|
(re.compile(r'</a>, <a href="http://www.jotdown.es/category', re.DOTALL|re.IGNORECASE), lambda match: ', <!--'),
|
||||||
(re.compile(r'</a>, <a href="http://www.jotdown.es/category',
|
(re.compile(r'"category tag">', re.DOTALL|re.IGNORECASE), lambda match: '--> '),
|
||||||
re.DOTALL | re.IGNORECASE), lambda match: ', <!--'),
|
(re.compile(r'</a> —', re.DOTALL|re.IGNORECASE), lambda match: ''),
|
||||||
(re.compile(r'"category tag">', re.DOTALL |
|
# To remove the link of the title
|
||||||
re.IGNORECASE), lambda match: '--> '),
|
(re.compile(r'<h1 class="title"><a href="', re.DOTALL|re.IGNORECASE), lambda match: '<h1 class="title"><div class="'),
|
||||||
(re.compile(r'</a> —', re.DOTALL |
|
(re.compile(r'</a></h1>', re.DOTALL|re.IGNORECASE), lambda match: '</div></h1>')
|
||||||
re.IGNORECASE), lambda match: ''),
|
|
||||||
# To remove the link of the title
|
|
||||||
(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>')
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user