From 0503a2f6523c93122c8eaf3cf10516b2d9f7d23b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Nov 2010 12:24:35 -0700 Subject: [PATCH] Various Spanish news sources by Gustavo Azambuja --- resources/recipes/180.recipe | 50 ++++++++++ resources/recipes/bitacora.recipe | 58 ++++++++++++ resources/recipes/cosmopolitan.recipe | 69 ++++++++++++++ resources/recipes/el_pais_uy.recipe | 67 +++++++++++++ resources/recipes/freeway.recipe | 100 ++++++++++++++++++++ resources/recipes/la_diaria.recipe | 48 ++++++++++ resources/recipes/la_razon_bo.recipe | 2 +- resources/recipes/montevideo_com.recipe | 56 +++++++++++ resources/recipes/observa_digital.recipe | 63 ++++++++++++ resources/recipes/revista_bla.recipe | 54 +++++++++++ src/calibre/web/feeds/recipes/collection.py | 5 + 11 files changed, 571 insertions(+), 1 deletion(-) create mode 100644 resources/recipes/180.recipe create mode 100644 resources/recipes/bitacora.recipe create mode 100644 resources/recipes/cosmopolitan.recipe create mode 100644 resources/recipes/el_pais_uy.recipe create mode 100644 resources/recipes/freeway.recipe create mode 100644 resources/recipes/la_diaria.recipe create mode 100644 resources/recipes/montevideo_com.recipe create mode 100644 resources/recipes/observa_digital.recipe create mode 100644 resources/recipes/revista_bla.recipe diff --git a/resources/recipes/180.recipe b/resources/recipes/180.recipe new file mode 100644 index 0000000000..5158bb99e0 --- /dev/null +++ b/resources/recipes/180.recipe @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +180.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Noticias(BasicNewsRecipe): + title = '180.com.uy' + __author__ = 'Gustavo Azambuja' + description = 'Noticias de Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'utf-8' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [dict(name='div', attrs={'class':'tef-md tef-md-seccion-sociedad'})] + remove_tags = [ + dict(name=['object','link']) + ] + + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Titulares', u'http://www.180.com.uy/feed.php') + ] + + def get_cover_url(self): + return 'http://www.180.com.uy/tplef/img/logo.gif' + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup + diff --git a/resources/recipes/bitacora.recipe b/resources/recipes/bitacora.recipe new file mode 100644 index 0000000000..a36eb52988 --- /dev/null +++ b/resources/recipes/bitacora.recipe @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +bitacora.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class General(BasicNewsRecipe): + title = 'bitacora.com.uy' + __author__ = 'Gustavo Azambuja' + description = 'Noticias de Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'iso-8859-1' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [dict(id=['txt'])] + remove_tags = [ + dict(name='div', attrs={'class':'tablafoot'}), + dict(name=['object','h4']), + dict(name=['object','link']) + ] + + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Titulares', u'http://www.bitacora.com.uy/anxml.cgi?15') + ] + + def get_cover_url(self): + cover_url = None + index = 'http://www.bitacora.com.uy' + soup = self.index_to_soup(index) + link_item = soup.find('img',attrs={'class':'imgtapa'}) + if link_item: + cover_url = "http://www.bitacora.com.uy/"+link_item['src'] + return cover_url + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup + diff --git a/resources/recipes/cosmopolitan.recipe b/resources/recipes/cosmopolitan.recipe new file mode 100644 index 0000000000..d7d3db7e0c --- /dev/null +++ b/resources/recipes/cosmopolitan.recipe @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +Muy Interesante +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class General(BasicNewsRecipe): + title = 'Cosmopolitan' + __author__ = 'Gustavo Azambuja' + description = 'Revista Cosmopolitan, Edicion Espanola' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 1 + encoding = 'utf8' + remove_javascript = True + no_stylesheets = True + conversion_options = {'linearize_tables': True} + + oldest_article = 180 + max_articles_per_feed = 100 + keep_only_tags = [ + dict(id=['contenido']), + dict(name='td', attrs={'class':['contentheading', 'txt_articulo']}) + ] + remove_tags = [ + dict(name='div', attrs={'class':['breadcrumb', 'bloque1', 'article', 'bajo_title', 'tags_articles', 'otrosenlaces_title', 'otrosenlaces_parent', 'compartir']}), + dict(name='div', attrs={'id':'comment'}), + dict(name='table', attrs={'class':'pagenav'}), + dict(name=['object','link']) + ] + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + img {float:left; clear:both; margin:10px} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Articulos', u'http://feeds.feedburner.com/cosmohispano/FSSt') + ] + + def preprocess_html(self, soup): + attribs = [ 'style','font','valign' + ,'colspan','width','height' + ,'rowspan','summary','align' + ,'cellspacing','cellpadding' + ,'frames','rules','border' + ] + for item in soup.body.findAll(name=['table','td','tr','th','caption','thead','tfoot','tbody','colgroup','col']): + item.name = 'div' + for attrib in attribs: + if item.has_key(attrib): + del item[attrib] + return soup + + def get_cover_url(self): + index = 'http://www.cosmohispano.com/revista' + soup = self.index_to_soup(index) + link_item = soup.find('img',attrs={'class':'img_portada'}) + if link_item: + cover_url = "http://www.cosmohispano.com"+link_item['src'] + return cover_url diff --git a/resources/recipes/el_pais_uy.recipe b/resources/recipes/el_pais_uy.recipe new file mode 100644 index 0000000000..b474b5c232 --- /dev/null +++ b/resources/recipes/el_pais_uy.recipe @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +http://www.elpais.com.uy/ +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class General(BasicNewsRecipe): + title = 'Diario El Pais' + __author__ = 'Gustavo Azambuja' + description = 'Noticias | Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 2 + encoding = 'iso-8859-1' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [ + dict(name='h1'), + dict(name='div', attrs={'id':'Contenido'}) + ] + remove_tags = [ + dict(name='div', attrs={'class':['date_text', 'comments', 'form_section', 'share_it']}), + dict(name='div', attrs={'id':['relatedPosts', 'spacer', 'banner_izquierda', 'right_container']}), + dict(name='p', attrs={'class':'FacebookLikeButton'}), + dict(name=['object','form']), + dict(name=['object','table']) ] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Ultimo Momento', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=umomento'), + (u'Editorial', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=editorial'), + (u'Nacional', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=nacional'), + (u'Internacional', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=internacional'), + (u'Espectaculos', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=espectaculos'), + (u'Deportes', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=deportes'), + (u'Ciudades', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=ciudades'), + (u'Economia', u'http://www.elpais.com.uy/formatos/rss/index.asp?seccion=economia') + ] + + def get_cover_url(self): + cover_url = None + index = 'http://www.elpais.com.uy' + soup = self.index_to_soup(index) + link_item = soup.find('div',attrs={'class':'boxmedio box257'}) + print link_item + if link_item: + cover_url = 'http://www.elpais.com.uy'+link_item.img['src'] + return cover_url + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup + diff --git a/resources/recipes/freeway.recipe b/resources/recipes/freeway.recipe new file mode 100644 index 0000000000..cb6d41ebb2 --- /dev/null +++ b/resources/recipes/freeway.recipe @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +http://freeway.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class General(BasicNewsRecipe): + title = 'freeway.com.uy' + __author__ = 'Gustavo Azambuja' + description = 'Revista Freeway, Montevideo, Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 1 + encoding = 'utf8' + remove_javascript = True + no_stylesheets = True + conversion_options = {'linearize_tables': True} + + oldest_article = 180 + max_articles_per_feed = 100 + keep_only_tags = [ + dict(id=['contenido']), + dict(name='a', attrs={'class':'titulo_art_ppal'}), + dict(name='img', attrs={'class':'recuadro'}), + dict(name='td', attrs={'class':'txt_art_ppal'}) + ] + remove_tags = [ + dict(name=['object','link']) + ] + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + img {float:left; clear:both; margin:10px} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + + def parse_index(self): + feeds = [] + for title, url in [('Articulos', 'http://freeway.com.uy/revista/')]: + articles = self.art_parse_section(url) + if articles: + feeds.append((title, articles)) + return feeds + + def art_parse_section(self, url): + soup = self.index_to_soup(url) + div = soup.find(attrs={'id': 'tbl_1'}) + + current_articles = [] + for tag in div.findAllNext(attrs = {'class': 'ancho_articulos'}): + if tag.get('class') == 'link-list-heading': + break + for td in tag.findAll('td'): + a = td.find('a', attrs= {'class': 'titulo_articulos'}) + if a is None: + continue + title = self.tag_to_string(a) + url = a.get('href', False) + if not url or not title: + continue + if url.startswith('/'): + url = 'http://freeway.com.uy'+url + p = td.find('p', attrs= {'class': 'txt_articulos'}) + description = self.tag_to_string(p) + self.log('\t\tFound article:', title) + self.log('\t\t\t', url) + self.log('\t\t\t', description) + current_articles.append({'title': title, 'url': url, 'description':description, 'date':''}) + + return current_articles + + def preprocess_html(self, soup): + attribs = [ 'style','font','valign' + ,'colspan','width','height' + ,'rowspan','summary','align' + ,'cellspacing','cellpadding' + ,'frames','rules','border' + ] + for item in soup.body.findAll(name=['table','td','tr','th','caption','thead','tfoot','tbody','colgroup','col']): + item.name = 'div' + for attrib in attribs: + if item.has_key(attrib): + del item[attrib] + return soup + + def get_cover_url(self): + #index = 'http://www.cosmohispano.com/revista' + #soup = self.index_to_soup(index) + #link_item = soup.find('img',attrs={'class':'img_portada'}) + #if link_item: + # cover_url = "http://www.cosmohispano.com"+link_item['src'] + return 'http://freeway.com.uy/_upload/_n_foto_grande/noticia_1792_tapanoviembre2010.jpg' diff --git a/resources/recipes/la_diaria.recipe b/resources/recipes/la_diaria.recipe new file mode 100644 index 0000000000..d89eb465dd --- /dev/null +++ b/resources/recipes/la_diaria.recipe @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +ladiaria.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class General(BasicNewsRecipe): + title = 'La Diaria' + __author__ = 'Gustavo Azambuja' + description = 'Noticias de Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'utf8' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [dict(id=['article'])] + remove_tags = [ + dict(name='div', attrs={'class':['byline', 'hr', 'titlebar', 'volver-arriba-right']}), + dict(name='div', attrs={'id':'discussion'}), + dict(name=['object','link']) + ] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Articulos', u'http://ladiaria.com/feeds/articulos') + ] + + def get_cover_url(self): + return 'http://ladiaria.com/edicion/imagenportada/' + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/resources/recipes/la_razon_bo.recipe b/resources/recipes/la_razon_bo.recipe index b7cd59d043..18a00d6763 100644 --- a/resources/recipes/la_razon_bo.recipe +++ b/resources/recipes/la_razon_bo.recipe @@ -8,7 +8,7 @@ from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class LaRazon_Bol(BasicNewsRecipe): - title = 'La Razón - Bolivia' + title = u'La Razón - Bolivia' __author__ = 'Darko Miletic' description = 'El diario nacional de Bolivia' publisher = 'Praxsis S.R.L.' diff --git a/resources/recipes/montevideo_com.recipe b/resources/recipes/montevideo_com.recipe new file mode 100644 index 0000000000..cabd4181d6 --- /dev/null +++ b/resources/recipes/montevideo_com.recipe @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +http://www.montevideo.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Noticias(BasicNewsRecipe): + title = 'Montevideo COMM' + __author__ = 'Gustavo Azambuja' + description = 'Noticias de Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'utf-8' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [dict(id=['txt'])] + remove_tags = [ + dict(name=['object','link']) + ] + + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Destacados', u'http://www.montevideo.com.uy/anxml.aspx?58'), + (u'Noticias', u'http://www.montevideo.com.uy/anxml.aspx?59'), + (u'Tecnologia', u'http://www.montevideo.com.uy/anxml.aspx?133'), + (u'Tiempo Libre', u'http://www.montevideo.com.uy/anxml.aspx?60'), + # (u'Deportes', u'http://www.montevideo.com.uy/anxml.aspx?968'), + # (u'Pantallazo', u'http://www.montevideo.com.uy/anxml.aspx?1022'), + (u'Gastronomia', u'http://www.montevideo.com.uy/anxml.aspx?1023') + ] + + def get_cover_url(self): + return 'http://sphotos.ak.fbcdn.net/hphotos-ak-snc1/hs276.snc1/10319_147339559330_147337559330_2625816_6636564_n.jpg' + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup + diff --git a/resources/recipes/observa_digital.recipe b/resources/recipes/observa_digital.recipe new file mode 100644 index 0000000000..375d67236c --- /dev/null +++ b/resources/recipes/observa_digital.recipe @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +observa.com.uy +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Noticias(BasicNewsRecipe): + title = 'Observa Digital' + __author__ = '2010, Gustavo Azambuja ' + description = 'Noticias desde Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'utf8' + remove_javascript = True + no_stylesheets = True + + oldest_article = 2 + max_articles_per_feed = 100 + keep_only_tags = [dict(id=['contenido'])] + remove_tags = [ + dict(name='div', attrs={'id':'contenedorVinculadas'}), + dict(name='p', attrs={'id':'nota_firma'}), + dict(name=['object','link']) + ] + + remove_attributes = ['width','height', 'style', 'font', 'color'] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Actualidad', u'http://www.observa.com.uy/RSS/actualidad.xml'), + (u'Deportes', u'http://www.observa.com.uy/RSS/deportes.xml'), + (u'Vida', u'http://www.observa.com.uy/RSS/vida.xml'), + (u'Ciencia y Tecnologia', u'http://www.observa.com.uy/RSS/ciencia.xml') + ] + + def get_cover_url(self): + cover_url = None + index = 'http://www.elobservador.com.uy/elobservador/nav_portada.asp?suplemento=dia' + soup = self.index_to_soup(index) + link_item = soup.find('img',attrs={'usemap':'#mapeo_imagenes'}) + if link_item: + cover_url = 'http://www.elobservador.com.uy'+link_item['src'].strip() + + print cover_url + + return cover_url + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/resources/recipes/revista_bla.recipe b/resources/recipes/revista_bla.recipe new file mode 100644 index 0000000000..15c7e7fb3f --- /dev/null +++ b/resources/recipes/revista_bla.recipe @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__author__ = '2010, Gustavo Azambuja ' +''' +http://www.revistabla.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Noticias(BasicNewsRecipe): + title = 'Revista Bla' + __author__ = 'Gustavo Azambuja' + description = 'Moda | Uruguay' + language = 'es' + timefmt = '[%a, %d %b, %Y]' + use_embedded_content = False + recursion = 5 + encoding = 'utf8' + remove_javascript = True + no_stylesheets = True + + oldest_article = 20 + max_articles_per_feed = 100 + keep_only_tags = [dict(id=['body_container'])] + remove_tags = [ + dict(name='div', attrs={'class':['date_text', 'comments', 'form_section', 'share_it']}), + dict(name='div', attrs={'id':['relatedPosts', 'spacer', 'banner_izquierda', 'right_container']}), + dict(name='p', attrs={'class':'FacebookLikeButton'}), + dict(name=['object','link']) ] + + extra_css = ''' + h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} + h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} + h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} + p {font-family:Arial,Helvetica,sans-serif;} + ''' + feeds = [ + (u'Articulos', u'http://www.revistabla.com/feed/') + ] + + def get_cover_url(self): + cover_url = None + index = 'http://www.revistabla.com' + soup = self.index_to_soup(index) + link_item = soup.find('div',attrs={'class':'header_right'}) + if link_item: + cover_url = link_item.img['src'] + return cover_url + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/src/calibre/web/feeds/recipes/collection.py b/src/calibre/web/feeds/recipes/collection.py index 5b34ddab0b..a513cf3880 100644 --- a/src/calibre/web/feeds/recipes/collection.py +++ b/src/calibre/web/feeds/recipes/collection.py @@ -61,6 +61,11 @@ def serialize_recipe(urn, recipe_class): def serialize_collection(mapping_of_recipe_classes): collection = E.recipe_collection() + '''for u, x in mapping_of_recipe_classes.items(): + print 11111, u, repr(x.title) + if isinstance(x.title, str): + x.title.decode('ascii') + ''' for urn in sorted(mapping_of_recipe_classes.keys(), key=lambda key: getattr(mapping_of_recipe_classes[key], 'title', 'zzz')):