| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2011, Silviu Cotoar\u0103' |
| 6 |
''' |
| 7 |
mediafax.ro |
| 8 |
''' |
| 9 |
|
| 10 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 11 |
|
| 12 |
|
| 13 |
class Mediafax(BasicNewsRecipe): |
| 14 |
title = 'Mediafax' |
| 15 |
__author__ = 'Silviu Cotoar\u0103' |
| 16 |
description = '\u0218tiri din Rom\u00e2nia' |
| 17 |
publisher = 'Mediafax' |
| 18 |
oldest_article = 5 |
| 19 |
language = 'ro' |
| 20 |
max_articles_per_feed = 100 |
| 21 |
no_stylesheets = True |
| 22 |
use_embedded_content = False |
| 23 |
category = 'Ziare,Stiri,Romania' |
| 24 |
encoding = 'utf-8' |
| 25 |
cover_url = 'http://storage0.dms.mpinteractiv.ro/media/1/1/1706/4134575/2/logo-mediafax-mass-media-news.jpg?width=400' |
| 26 |
|
| 27 |
conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher} |
| 28 |
|
| 29 |
keep_only_tags = [dict(name='div', attrs={'class': 'news tabs-container'})] |
| 30 |
|
| 31 |
remove_tags = [dict(name='ul', attrs={'class': ['CategoryNews']}), dict(name='div', attrs={'class': ['read']})] |
| 32 |
|
| 33 |
remove_tags_after = [dict(name='div', attrs={'class': 'cmsItemViews'})] |
| 34 |
|
| 35 |
feeds = [('Actualitate', 'http://www.mediafax.ro/rss/')] |
| 36 |
|
| 37 |
def preprocess_html(self, soup): |
| 38 |
return self.adeify_images(soup) |