diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index d7e9a8930e..2fd1c74ba8 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -48,7 +48,8 @@ recipe_modules = ['recipe_' + r for r in ( 'the_budget_fashionista', 'elperiodico_catalan', 'elperiodico_spanish', 'expansion_spanish', 'lavanguardia', 'marca', 'kellog_faculty', 'kellog_insight', - 'theeconomictimes_india', + 'theeconomictimes_india', '7dias', 'buenosaireseconomico', + 'diagonales', 'miradasalsur', 'newsweek_argentina', 'veintitres', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_7dias.py b/src/calibre/web/feeds/recipes/recipe_7dias.py new file mode 100644 index 0000000000..48970f2081 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_7dias.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class SieteDias(BasicNewsRecipe): + title = '7 dias' + __author__ = 'Darko Miletic' + description = 'Revista Argentina' + publisher = 'ElArgentino.com' + category = 'news, politics, show, Argentina' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/125/7-Dias.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=125&Content-Type=text/xml&ChannelDesc=7%20D%C3%ADas')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img diff --git a/src/calibre/web/feeds/recipes/recipe_buenosaireseconomico.py b/src/calibre/web/feeds/recipes/recipe_buenosaireseconomico.py new file mode 100644 index 0000000000..68e917284f --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_buenosaireseconomico.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class BsAsEconomico(BasicNewsRecipe): + title = 'Buenos Aires Economico' + __author__ = 'Darko Miletic' + description = 'Revista Argentina' + publisher = 'ElArgentino.com' + category = 'news, politics, economy, Argentina' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/121/Buenos-Aires-Economico.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=121&Content-Type=text/xml&ChannelDesc=Buenos%20Aires%20Econ%C3%B3mico')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img diff --git a/src/calibre/web/feeds/recipes/recipe_diagonales.py b/src/calibre/web/feeds/recipes/recipe_diagonales.py new file mode 100644 index 0000000000..9a8b3fe758 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_diagonales.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class Diagonales(BasicNewsRecipe): + title = 'Diagonales' + __author__ = 'Darko Miletic' + description = 'El nuevo diario de La Plata' + publisher = 'ElArgentino.com' + category = 'news, politics, Argentina, La Plata' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/122/Diagonales.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=122&Content-Type=text/xml&ChannelDesc=Diagonales')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img diff --git a/src/calibre/web/feeds/recipes/recipe_miradasalsur.py b/src/calibre/web/feeds/recipes/recipe_miradasalsur.py new file mode 100644 index 0000000000..fa8f8a753d --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_miradasalsur.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class MiradasAlSur(BasicNewsRecipe): + title = 'Miradas al Sur' + __author__ = 'Darko Miletic' + description = 'Revista Argentina' + publisher = 'ElArgentino.com' + category = 'news, politics, Argentina' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/123/Miradas-al-Sur.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=123&Content-Type=text/xml&ChannelDesc=Miradas%20al%20Sur')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img diff --git a/src/calibre/web/feeds/recipes/recipe_newsweek_argentina.py b/src/calibre/web/feeds/recipes/recipe_newsweek_argentina.py new file mode 100644 index 0000000000..5c1c867a51 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_newsweek_argentina.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class Newsweek_Argentina(BasicNewsRecipe): + title = 'NewsWeek Argentina' + __author__ = 'Darko Miletic' + description = 'Revista dedicada a politica' + publisher = 'ElArgentino.com' + category = 'news, politics, world, Argentina' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/126/Newsweek.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=126&Content-Type=text/xml&ChannelDesc=Newsweek')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img diff --git a/src/calibre/web/feeds/recipes/recipe_veintitres.py b/src/calibre/web/feeds/recipes/recipe_veintitres.py new file mode 100644 index 0000000000..165d9a7efc --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_veintitres.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +elargentino.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class Veintitres(BasicNewsRecipe): + title = 'Veintitres' + __author__ = 'Darko Miletic' + description = 'Revista Argentino dedicada a politica' + publisher = 'Veintitres' + category = 'news, politics, Argentina' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Spanish') + lang = 'es-AR' + direction = 'ltr' + INDEX = 'http://www.elargentino.com/medios/120/veintitres.html' + extra_css = ' .titulo{font-size: x-large; font-weight: bold} .volantaImp{font-size: small; font-weight: bold} ' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "' + + keep_only_tags = [dict(name='div', attrs={'class':'ContainerPop'})] + + remove_tags = [dict(name='link')] + + feeds = [(u'Articulos', u'http://www.elargentino.com/Highlights.aspx?ParentType=Section&ParentId=120&Content-Type=text/xml&ChannelDesc=Veintitres')] + + def print_version(self, url): + main, sep, article_part = url.partition('/nota-') + article_id, rsep, rrest = article_part.partition('-') + return u'http://www.elargentino.com/Impresion.aspx?Id=' + article_id + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return soup + + def get_cover_url(self): + cover_url = None + soup = self.index_to_soup(self.INDEX) + cover_item = soup.find('div',attrs={'class':'colder'}) + if cover_item: + clean_url = self.image_url_processor(None,cover_item.div.img['src']) + cover_url = 'http://www.elargentino.com' + clean_url + '&height=600' + return cover_url + + def image_url_processor(self, baseurl, url): + base, sep, rest = url.rpartition('?Id=') + img, sep2, rrest = rest.partition('&') + return base + sep + img