| 1 |
# -*- coding: utf-8 -*- |
| 2 |
__license__ = 'GPL v3' |
| 3 |
__copyright__ = '2011 Aurélien Chabot <[email protected]>' |
| 4 |
''' |
| 5 |
20minutes.fr |
| 6 |
''' |
| 7 |
from calibre.web.feeds.recipes import BasicNewsRecipe |
| 8 |
|
| 9 |
|
| 10 |
def classes(classes): |
| 11 |
q = frozenset(classes.split(' ')) |
| 12 |
return dict(attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)}) |
| 13 |
|
| 14 |
|
| 15 |
class Minutes(BasicNewsRecipe): |
| 16 |
title = '20 minutes' |
| 17 |
__author__ = 'Aurélien Chabot' |
| 18 |
description = 'Actualités' |
| 19 |
encoding = 'utf-8' |
| 20 |
publisher = '20minutes.fr' |
| 21 |
category = 'Actualités, France, Monde' |
| 22 |
language = 'fr' |
| 23 |
|
| 24 |
use_embedded_content = False |
| 25 |
timefmt = ' [%d %b %Y]' |
| 26 |
max_articles_per_feed = 15 |
| 27 |
no_stylesheets = True |
| 28 |
remove_empty_feeds = True |
| 29 |
|
| 30 |
keep_only_tags = [ |
| 31 |
dict(name='h1'), |
| 32 |
classes('lt-endor-body'), |
| 33 |
] |
| 34 |
remove_tags = [ |
| 35 |
classes('content-related sharebar'), |
| 36 |
] |
| 37 |
remove_tags_after = dict(id='ob_holder') |
| 38 |
|
| 39 |
feeds = [ |
| 40 |
('France', 'http://www.20minutes.fr/rss/actu-france.xml'), |
| 41 |
('International', 'http://www.20minutes.fr/rss/monde.xml'), |
| 42 |
('Tech/Web', 'http://www.20minutes.fr/rss/hightech.xml'), |
| 43 |
('Sciences', 'http://www.20minutes.fr/rss/sciences.xml'), |
| 44 |
('Economie', 'http://www.20minutes.fr/rss/economie.xml'), |
| 45 |
('Politique', 'http://www.20minutes.fr/rss/politique.xml'), |
| 46 |
('Médias', 'http://www.20minutes.fr/rss/media.xml'), |
| 47 |
('Cinema', 'http://www.20minutes.fr/rss/cinema.xml'), |
| 48 |
('People', 'http://www.20minutes.fr/rss/people.xml'), |
| 49 |
('Culture', 'http://www.20minutes.fr/rss/culture.xml'), |
| 50 |
('Sport', 'http://www.20minutes.fr/rss/sport.xml'), |
| 51 |
('Paris', 'http://www.20minutes.fr/rss/paris.xml'), |
| 52 |
('Lyon', 'http://www.20minutes.fr/rss/lyon.xml'), |
| 53 |
('Toulouse', 'http://www.20minutes.fr/rss/toulouse.xml'), |
| 54 |
] |