From f30784352f644e4a8d12282720d5a3862907c8c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 May 2010 13:42:13 -0600 Subject: [PATCH] Ansa and Punto Informatico by Gabriele Marini --- resources/recipes/Ansa.recipe | 72 ++++++++++++++++++++++ resources/recipes/punto_informatico.recipe | 38 ++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 resources/recipes/Ansa.recipe create mode 100644 resources/recipes/punto_informatico.recipe diff --git a/resources/recipes/Ansa.recipe b/resources/recipes/Ansa.recipe new file mode 100644 index 0000000000..8ee4cc32a7 --- /dev/null +++ b/resources/recipes/Ansa.recipe @@ -0,0 +1,72 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__author__ = 'Gabriele Marini, based on Darko Miletic' +__copyright__ = '2010, Darko Miletic ' +description = 'Italian daily newspaper - 01-05-2010' +''' +http://www.ansa.it/ +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Ansa(BasicNewsRecipe): + __author__ = 'Gabriele Marini' + description = 'Italian News Agency' + + cover_url = 'http://www.ansa.it/web/images/logo_ansa_interna.gif' + title = u'Ansa' + publisher = 'Ansa' + category = 'News, politics, culture, economy, general interest' + + language = 'it' + timefmt = '[%a, %d %b, %Y]' + + oldest_article = 1 + max_articles_per_feed = 10 + use_embedded_content = False + recursion = 10 + + remove_javascript = True + no_stylesheets = True + conversion_options = {'linearize_tables':True} + remove_attributes = ['colspan'] + + keep_only_tags = [dict(name='div', attrs={'class':['path','header-content','corpo']}), + ] + + + remove_tags = [ + dict(name='div', attrs={'class':'tools-bar'}), + dict(name='div', attrs={'id':['rssdiv','blocco']}) + ] + + + feeds = [ + (u'HomePage', u'http://www.ansa.it/web/ansait_web_rss_homepage.xml'), + (u'Top New', u'http://www.ansa.it/web/notizie/rubriche/topnews/topnews_rss.xml'), + (u'Cronaca', u'http://www.ansa.it/web/notizie/rubriche/cronaca/cronaca_rss.xml'), + (u'Mondo', u'http://www.ansa.it/web/notizie/rubriche/mondo/mondo_rss.xml'), + (u'Economia', u'http://www.ansa.it/web/notizie/rubriche/economia/economia_rss.xml'), + (u'Politica', u'http://www.ansa.it/web/notizie/rubriche/politica/politica_rss.xml'), + (u'Scienze', u'http://www.ansa.it/web/notizie/rubriche/scienza/scienza_rss.xml'), + (u'Cinema', u'http://www.ansa.it/web/notizie/rubriche/cinema/cinema_rss.xml'), + (u'Tecnologia e Internet', u'http://www.ansa.it/web/notizie/rubriche/tecnologia/tecnologia_rss.xml'), + (u'Spettacolo', u'http://www.ansa.it/web/notizie/rubriche/spettacolo/spettacolo_rss.xml'), + (u'Cultura e Tendenze', u'http://www.ansa.it/web/notizie/rubriche/cultura/cultura_rss.xml'), + (u'Sport', u'http://www.ansa.it/web/notizie/rubriche/altrisport/altrisport_rss.xml'), + (u'Calcio', u'http://www.ansa.it/web/notizie/rubriche/calcio/calcio_rss.xml'), + (u'Lazio', u'http://www.ansa.it/web/notizie/regioni/lazio/lazio_rss.xml'), + (u'Lombardia', u'http://www.ansa.it/web/notizie/regioni/lombardia/lombardia.shtml'), + (u'Veneto', u'http://www.ansa.it/web/notizie/regioni/veneto/veneto.shtml'), + (u'Campanioa', u'http://www.ansa.it/web/notizie/regioni/campania/campania.shtml'), + (u'Sicilia', u'http://www.ansa.it/web/notizie/regioni/sicilia/sicilia.shtml'), + (u'Toscana', u'http://www.ansa.it/web/notizie/regioni/toscana/toscana.shtml'), + (u'Trentino', u'http://www.ansa.it/web/notizie/regioni/trentino/trentino.shtml') + ] + + extra_css = ''' + .path{font-style: italic; font-size: small} + .header-content h1{font-weight: bold; font-size: xx-large} + .header-content h2{font-weight: bold; font-size: x-large; font-syle: italic} + .content-corpo{font-size: 14px;font-family: Times New Roman;} + ''' diff --git a/resources/recipes/punto_informatico.recipe b/resources/recipes/punto_informatico.recipe new file mode 100644 index 0000000000..3553d3341f --- /dev/null +++ b/resources/recipes/punto_informatico.recipe @@ -0,0 +1,38 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__author__ = 'Gabriele Marini' +__copyright__ = 'Gabriele Marini' +__description__ = 'Punto Informatico' + +''' +http://www.punto-informatico.it/ +''' + +from calibre.web.feeds.news import BasicNewsRecipe + + +class PuntoInformatico(BasicNewsRecipe): + __author__ = 'Gabriele Marini' + description = 'Punto Informatico: Internet dal 1996' + + cover_url = 'http://punto-informatico.it/images/logo_8bit.png' + title = u'Punto Informatico ' + publisher = 'italiaNews High Tech' + category = 'News, Information Tecnology' + + language = 'it' + timefmt = '[%a, %d %b, %Y]' + + oldest_article = 15 + max_articles_per_feed = 50 + use_embedded_content = False + + remove_javascript = True + no_stylesheets = True + keep_only_tags = [dict(name='div', attrs={'class':'box'})] + remove_tags = [dict(name='div',attrs={'class':'boxadv'})] + def get_article_url(self, article): + return article.get('id', article.get('guid', None)) + + feeds = [(u'Punto Informatico',u'http://feeds.punto-informatico.it/c/32288/f/438866/index.rss')] +