From 0b362bea08347713ffea9414c5b897f2b68f4a12 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 20 Feb 2019 18:09:02 +0530 Subject: [PATCH] Update Granma --- recipes/granma.recipe | 35 ++++++----------------------------- recipes/icons/granma.png | Bin 301 -> 1094 bytes 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/recipes/granma.recipe b/recipes/granma.recipe index 8f2dfebba1..157e04633e 100644 --- a/recipes/granma.recipe +++ b/recipes/granma.recipe @@ -1,9 +1,9 @@ #!/usr/bin/env python2 __license__ = 'GPL v3' -__copyright__ = '2008-2009, Darko Miletic ' +__copyright__ = '2008-2019, Darko Miletic ' ''' -granma.cubaweb.cu +granma.cu ''' from calibre.web.feeds.news import BasicNewsRecipe @@ -19,33 +19,10 @@ class Granma(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - encoding = 'cp1252' - cover_url = 'http://www.granma.cubaweb.cu/imagenes/granweb229d.jpg' + encoding = 'utf8' + masthead_url = 'http://www.granma.cu/static/img/granma-logo.png' language = 'es_CU' - + auto_cleanup = True remove_javascript = True - html2lrf_options = [ - '--comment', description, '--category', category, '--publisher', publisher, '--ignore-tables' - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + \ - description + '"\ntags="' + category + '"\nlinearize_tables=True' - - keep_only_tags = [dict(name='table', attrs={'height': '466'})] - - remove_tags = [dict(name=['embed', 'link', 'object'])] - - feeds = [(u'Noticias', u'http://www.granma.cubaweb.cu/noticias.xml')] - - def preprocess_html(self, soup): - mtag = '' - soup.head.insert(0, mtag) - for item in soup.findAll('table'): - if item.has_key('width'): # noqa - del item['width'] - if item.has_key('height'): # noqa - del item['height'] - for item in soup.findAll(style=True): - del item['style'] - return soup + feeds = [(u'Noticias', u'http://www.granma.cu/feed')] diff --git a/recipes/icons/granma.png b/recipes/icons/granma.png index d80760470be1902b5bcb8319be3374842431f23f..592a73bc60fab8aae4cf7e47aaad713f91db69b5 100644 GIT binary patch literal 1094 zcmV-M1iAZ(P)1p|NQz5fnWuENb9K9CEtnfN5k)rw;Oug)11Mpui&yLeXCpU z8ql}T(vrS_4O3fA{CP+t2u={UFW_>x06*$GP%6Vg8YTgaFa}u`;#rzy_zQ?59HYqZ zEWk68W+a}2w*`GS!yd`HTD|r1Q2}?(X@XGKbzzr;$~+;Q=lM`0jsuSf?2B|wA4q#K zR;ak8MrbFL1Vh|x)xi}Ijw7`CTvpofG)_oWi~2?*97gCLU|oL2x;20N7;QH% znxi$h>R>4M@QZ=0NojcFl-VftJig-HPB~?FN`vw~1D_s*WU8~DPx!hfH`2OBQhrkv z&}Tv+7@1e|>u-zId@);=7+)v(GFq<6IF3r3q-m9m+)B|y%cUE+?47%qh(%_(?=TR5*=&lRapYQ51%s_a-S8L==RYF9AEK5JM3}90j2jaj{ELaBvf;le$&J zBDkrbPHut@)=5VT#SY>i6|}V}4leS2Nn7y;q}adYb?BGUrm1JT_niB__qpeAMVoj7 z*?ckI+du=L<3I%L0RCdn*jy-AtKR_BDy~FPFG2T#o_6MG)QtMear}OhL8VZ*2_8lY zX=({Gh8m-;^Cctwv2?~_2(w_-2eO;Q;`Ta}{h}ULhkD}qugx>>ip9>|_z8f-uN7ye zvMF{Sco>B2dP7_*C)J0o+da;vLPG2=m8 zD%ENq05ly%XBG4^#eQ2#swV{Au6u?cXf*dh;{1A1z5~c@rqhg#Vt_2tv2^`=KCX>- z6bjJ_epQk7Z@6~ENpiIe%dLh1dtZ7gISGpglO$fOH%?@~ M07*qoM6N<$f