| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
__license__ = 'GPL v3' |
| 4 |
__author__ = '2010, Gustavo Azambuja <hola at gazambuja.com>' |
| 5 |
''' |
| 6 |
http://www.montevideo.com.uy |
| 7 |
''' |
| 8 |
|
| 9 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 10 |
|
| 11 |
|
| 12 |
class Noticias(BasicNewsRecipe): |
| 13 |
title = 'Montevideo COMM' |
| 14 |
__author__ = 'Gustavo Azambuja' |
| 15 |
description = 'Noticias de Uruguay' |
| 16 |
language = 'es_UY' |
| 17 |
timefmt = '[%a, %d %b, %Y]' |
| 18 |
use_embedded_content = False |
| 19 |
recursion = 5 |
| 20 |
encoding = 'utf-8' |
| 21 |
remove_javascript = True |
| 22 |
no_stylesheets = True |
| 23 |
|
| 24 |
oldest_article = 2 |
| 25 |
max_articles_per_feed = 100 |
| 26 |
keep_only_tags = [dict(id=['txt'])] |
| 27 |
remove_tags = [dict(name=['object', 'link'])] |
| 28 |
|
| 29 |
remove_attributes = ['width', 'height', 'style', 'font', 'color'] |
| 30 |
|
| 31 |
extra_css = ''' |
| 32 |
h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;} |
| 33 |
h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;} |
| 34 |
h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;} |
| 35 |
p {font-family:Arial,Helvetica,sans-serif;} |
| 36 |
''' |
| 37 |
feeds = [ |
| 38 |
('Destacados', 'http://www.montevideo.com.uy/anxml.aspx?58'), |
| 39 |
('Noticias', 'http://www.montevideo.com.uy/anxml.aspx?59'), |
| 40 |
('Tecnologia', 'http://www.montevideo.com.uy/anxml.aspx?133'), |
| 41 |
('Tiempo Libre', 'http://www.montevideo.com.uy/anxml.aspx?60'), |
| 42 |
# (u'Deportes', u'http://www.montevideo.com.uy/anxml.aspx?968'), |
| 43 |
# (u'Pantallazo', u'http://www.montevideo.com.uy/anxml.aspx?1022'), |
| 44 |
('Gastronomia', 'http://www.montevideo.com.uy/anxml.aspx?1023'), |
| 45 |
] |
| 46 |
|
| 47 |
def get_cover_url(self): |
| 48 |
return 'http://sphotos.ak.fbcdn.net/hphotos-ak-snc1/hs276.snc1/10319_147339559330_147337559330_2625816_6636564_n.jpg' |
| 49 |
|
| 50 |
def preprocess_html(self, soup): |
| 51 |
for item in soup.findAll(style=True): |
| 52 |
del item['style'] |
| 53 |
return soup |