From 5f518fba1d9280bc9945518c7b6897dff5e2e020 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Aug 2013 15:56:37 +0530 Subject: [PATCH] Jot Down by desUbiKado --- recipes/jot_down.recipe | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 recipes/jot_down.recipe diff --git a/recipes/jot_down.recipe b/recipes/jot_down.recipe new file mode 100644 index 0000000000..ac5a0b7010 --- /dev/null +++ b/recipes/jot_down.recipe @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 +from __future__ import unicode_literals +__license__ = 'GPL v3' +__copyright__ = '23 June 2013, desUBIKado' +__author__ = 'desUBIKado' +__description__ = 'Contemporary Culture Magazine' +__version__ = 'v0.01' +__date__ = '23, June 2013' +''' +http://www.jotdown.es/ +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class jotdown(BasicNewsRecipe): + author = 'desUBIKado' + description = 'Revista digital con magníficos y extensos artículos' + title = u'Jot Down - Contemporary Culture Magazine' + publisher = 'Wabi Sabi Investments, S.C.' + category = 'Opinion, culture, science, movies, TV shows, music, blogs' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + oldest_article = 7 + delay = 1 + max_articles_per_feed = 20 + masthead_url = 'http://www.jotdown.es/wp-content/uploads/2011/04/logoJotDown.png' + use_embedded_content = False + remove_javascript = True + no_stylesheets = True + + feeds = [ + (u'Portada', u'http://www.jotdown.es/feed/') + ] + + keep_only_tags = [dict(name='div', attrs={'class':['single']}), + 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={'align':['center']}), + dict(name='span', attrs={'class':['fbreplace']}), + 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'', re.DOTALL|re.IGNORECASE), lambda match: '
'), + (re.compile(r' —', re.DOTALL|re.IGNORECASE), lambda match: ''), + # To remove the link of the title + (re.compile(r'

', re.DOTALL|re.IGNORECASE), lambda match: '
') + + ] +