View Single Post
Old 05-04-2012, 11:03 AM   #1
cram1010
Member
cram1010 began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2012
Device: Bq cervantes
Recipe for rebelion.org

Here it is the recipe for http://www.rebelion.org. Thanks a lot to atlantique for his help.

Code:
from calibre.web.feeds.news import BasicNewsRecipe
import re

class RebelionRecipe (BasicNewsRecipe):
   __author__ = 'Marc Busqué <marc@lamarciana.com>' #Thanks to atlantique https://www.mobileread.com/forums/member.php?u=67876
   __url__ = 'http://www.lamarciana.com'
   __version__ = '1.0'
   __license__   = 'GPL v3'
   __copyright__ = '2012, Marc Busqué <marc@lamarciana.com>'
   title = u'Rebelion.org'
   description = u'Rebelión pretende ser un medio de información alternativa que publique las noticias que no son consideradas importantes por los medios de comunicación tradicionales. También, dar a las noticias un tratamiento diferente en la línea de mostrar los intereses que los poderes económicos y políticos del mundo capitalista ocultan para mantener sus privilegios y el status actual. Queremos servir y ayudarnos de todos los grupos, colectivos y personas que trabajan por cambiar este mundo en una perspectiva radicalmente diferente, más justa, igualitaria y equilibrada social y ecológicamente. Es nuestro objetivo contar con la participación y colaboración de todos vosotros para que Rebelión sea un espacio serio, riguroso y actualizado en la difusión de noticias.'
   url = 'http://www.rebelion.org'
   language = 'es'
   tags = 'contrainformación, información alternativa'
   oldest_article = 1
   remove_empty_feeds = True
   encoding = 'latin1' #
   keep_only_tags = [
     {'name': 'div', 'attrs': {'id': 'CuerpoNoticia'}}
   ]
   no_stylesheets = True
   extra_css = '.autor {font-style: italic;} .titulo {font-size: 150%;} .titulo, .pretitulo {text-align: center;} #TextoNoticia {text-align:justify;} .autor, .fuente, .entradilla {font-size: 90%; text-align: left;}'

   feeds = [
         (u'Titulares del día', u'http://www.rebelion.org/rss_portada.php'),
         ]

   #See https://www.mobileread.com/forums/showthread.php?t=174501
   def print_version(self, url):
      id = re.compile('\d*$').search(url).group()
      return u'http://www.rebelion.org/noticia.php?id=%s' % id
cram1010 is offline   Reply With Quote