diff --git a/resources/images/news/elpais_semanal.png b/resources/images/news/elpais_semanal.png new file mode 100644 index 0000000000..b82ff81535 Binary files /dev/null and b/resources/images/news/elpais_semanal.png differ diff --git a/resources/recipes/axxon_magazine.recipe b/resources/recipes/axxon_magazine.recipe new file mode 100644 index 0000000000..331e6fe2b5 --- /dev/null +++ b/resources/recipes/axxon_magazine.recipe @@ -0,0 +1,64 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +axxon.com.ar +''' +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class Axxon_news(BasicNewsRecipe): + title = 'Revista Axxon' + __author__ = 'Darko Miletic' + description = 'Axxon, Ciencia Ficcion en Bits' + publisher = 'Revista Axxon - Ciencia Ficcion' + category = 'SF, Argentina' + oldest_article = 31 + delay = 1 + max_articles_per_feed = 100 + no_stylesheets = False + use_embedded_content = False + language = 'es' + encoding = 'utf-8' + publication_type = 'magazine' + INDEX = 'http://axxon.com.ar/rev/' + extra_css = ' body{font-family: Verdana,Arial,sans-serif} .editorial{font-family: serif} .posttitle{font-family: "Trebuchet MS","Lucida Grande",Verdana,Arial,sans-serif} .cuento{font-family: "Times New Roman", serif} .biografia{color: red; font-weight: bold; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + + keep_only_tags = [dict(name='div', attrs={'class':'post'})] + remove_tags = [dict(name=['object','link','iframe','embed','img'])] + remove_tags_after = [dict(attrs={'class':['editorial','correo','biografia','articulo']})] + remove_attributes = ['width','height','font','border','align'] + + def parse_index(self): + articles = [] + soup = self.index_to_soup(self.INDEX) + + for item in soup.findAll('strong'): + description = '' + title_prefix = '' + feed_link = item.find('a') + if feed_link and feed_link.has_key('href') and feed_link['href'].startswith('?p='): + url = self.INDEX + feed_link['href'] + title = title_prefix + self.tag_to_string(feed_link) + date = strftime(self.timefmt) + articles.append({ + 'title' :title + ,'date' :date + ,'url' :url + ,'description':description + }) + return [(soup.head.title.string, articles)] + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup) + diff --git a/resources/recipes/elpais_semanal.recipe b/resources/recipes/elpais_semanal.recipe new file mode 100644 index 0000000000..4667cc550a --- /dev/null +++ b/resources/recipes/elpais_semanal.recipe @@ -0,0 +1,56 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +www.elpais.com/suple/eps/ +''' + +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class ElPaisSemanal(BasicNewsRecipe): + title = 'El Pais semanal' + __author__ = 'Darko Miletic' + description = 'Revista semanal de diario El Pais' + publisher = 'EL PAIS S.L.' + category = 'news, politics, Spain' + no_stylesheets = True + encoding = 'cp1252' + use_embedded_content = False + language = 'es' + publication_type = 'magazine' + masthead_url = 'http://www.elpais.com/im/tit_logo_int.gif' + index = 'http://www.elpais.com/suple/eps/' + extra_css = ' p{text-align: justify} body{ text-align: left; font-family: Georgia,"Times New Roman",Times,serif } h2{font-family: Arial,Helvetica,sans-serif} img{margin-bottom: 0.4em} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + keep_only_tags=[dict(attrs={'class':['cabecera_noticia','contenido_noticia']})] + remove_attributes=['width','height'] + remove_tags=[dict(name='link')] + + def parse_index(self): + articles = [] + soup = self.index_to_soup(self.index) + for item in soup.findAll('a',attrs={'class':['g19i003','g17r003','g17i003']}): + description = '' + title_prefix = '' + feed_link = item + if item.has_key('href'): + url = 'http://www.elpais.com' + item['href'].rpartition('/')[0] + title = title_prefix + self.tag_to_string(feed_link) + date = strftime(self.timefmt) + articles.append({ + 'title' :title + ,'date' :date + ,'url' :url + ,'description':description + }) + return [(soup.head.title.string, articles)] + + def print_version(self, url): + return url + '?print=1'