| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2011, Silviu Cotoar\u0103' |
| 6 |
''' |
| 7 |
adevarul.ro |
| 8 |
''' |
| 9 |
|
| 10 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 11 |
|
| 12 |
|
| 13 |
class Adevarul(BasicNewsRecipe): |
| 14 |
title = 'Adev\u0103rul' |
| 15 |
language = 'ro' |
| 16 |
__author__ = 'Silviu Cotoar\u0103' |
| 17 |
description = '\u0218tiri din Rom\u00e2nia' |
| 18 |
publisher = 'Adevarul' |
| 19 |
category = 'Ziare,Stiri,Romania' |
| 20 |
oldest_article = 5 |
| 21 |
max_articles_per_feed = 100 |
| 22 |
no_stylesheets = True |
| 23 |
use_embedded_content = False |
| 24 |
encoding = 'utf-8' |
| 25 |
remove_javascript = True |
| 26 |
cover_url = 'http://upload.wikimedia.org/wikipedia/en/d/d6/Logo_noul_adevarul.png' |
| 27 |
|
| 28 |
conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher} |
| 29 |
|
| 30 |
keep_only_tags = [dict(name='div', attrs={'class': 'article_header'}), dict(name='div', attrs={'class': 'bb-tu first-t bb-article-body'})] |
| 31 |
|
| 32 |
remove_tags = [ |
| 33 |
dict(name='li', attrs={'class': 'author'}), |
| 34 |
dict(name='li', attrs={'class': 'date'}), |
| 35 |
dict(name='li', attrs={'class': 'comments'}), |
| 36 |
dict(name='div', attrs={'class': 'bb-wg-article_related_attachements'}), |
| 37 |
dict(name='div', attrs={'class': 'bb-md bb-md-article_comments'}), |
| 38 |
dict(name='form', attrs={'id': 'bb-comment-create-form'}), |
| 39 |
dict(name='div', attrs={'id': 'mediatag'}), |
| 40 |
dict(name='div', attrs={'id': 'ft'}), |
| 41 |
dict(name='div', attrs={'id': 'comment_wrapper'}), # noqa: E501 |
| 42 |
] |
| 43 |
|
| 44 |
remove_tags_after = [ |
| 45 |
dict(name='div', attrs={'id': 'comment_wrapper'}), |
| 46 |
] |
| 47 |
|
| 48 |
feeds = [('\u0218tiri', 'http://www.adevarul.ro/rss/latest')] |
| 49 |
|
| 50 |
def preprocess_html(self, soup): |
| 51 |
return self.adeify_images(soup) |