| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2011, Silviu Cotoar\u0103' |
| 6 |
''' |
| 7 |
sfin.ro |
| 8 |
''' |
| 9 |
|
| 10 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 11 |
|
| 12 |
|
| 13 |
class Sfin(BasicNewsRecipe): |
| 14 |
title = 'S\u0103pt\u0103m\u00e2na Financiar\u0103' |
| 15 |
__author__ = 'Silviu Cotoar\u0103' |
| 16 |
description = 'SFIN' |
| 17 |
publisher = 'SFIN' |
| 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,Economie,Business' |
| 24 |
encoding = 'utf-8' |
| 25 |
cover_url = 'http://img.9am.ro/images/logo_surse/saptamana_financiara.gif' |
| 26 |
|
| 27 |
conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher} |
| 28 |
|
| 29 |
keep_only_tags = [dict(name='div', attrs={'class': 'col2ContentLeft'}), dict(name='div', attrs={'id': 'contentArticol'})] |
| 30 |
|
| 31 |
remove_tags = [ |
| 32 |
dict(name='div', attrs={'class': ['infoArticol']}), |
| 33 |
dict(name='div', attrs={'class': ['separator']}), |
| 34 |
dict(name='div', attrs={'class': ['tags']}), |
| 35 |
dict(name='div', attrs={'id': ['comments']}), |
| 36 |
dict(name='div', attrs={'class': 'boxForm'}), |
| 37 |
] |
| 38 |
|
| 39 |
remove_tags_after = [dict(name='div', attrs={'class': 'tags'})] |
| 40 |
|
| 41 |
feeds = [('Feeds', 'http://www.sfin.ro/rss')] |
| 42 |
|
| 43 |
def preprocess_html(self, soup): |
| 44 |
return self.adeify_images(soup) |