| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = '2011, Silviu Cotoar\u0103' |
| 6 |
''' |
| 7 |
onemagazine.ro |
| 8 |
''' |
| 9 |
|
| 10 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 11 |
|
| 12 |
|
| 13 |
class Onemagazine(BasicNewsRecipe): |
| 14 |
title = 'The ONE' |
| 15 |
__author__ = 'Silviu Cotoar\u0103' |
| 16 |
description = 'Be the ONE, not anyone ..' |
| 17 |
publisher = 'The ONE' |
| 18 |
oldest_article = 25 |
| 19 |
language = 'ro' |
| 20 |
max_articles_per_feed = 100 |
| 21 |
no_stylesheets = True |
| 22 |
use_embedded_content = False |
| 23 |
category = 'Ziare,Reviste,Femei' |
| 24 |
encoding = 'utf-8' |
| 25 |
cover_url = 'http://www.onemagazine.ro/images/logo_rss.jpg' |
| 26 |
|
| 27 |
conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher} |
| 28 |
|
| 29 |
extra_css = ''' |
| 30 |
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} |
| 31 |
h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} |
| 32 |
.byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} |
| 33 |
.date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} |
| 34 |
p{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 35 |
.copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} |
| 36 |
.story{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 37 |
.entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 38 |
.pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 39 |
.maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 40 |
.story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} |
| 41 |
body{font-family:Helvetica,Arial,sans-serif;font-size:small;} |
| 42 |
''' |
| 43 |
|
| 44 |
keep_only_tags = [ |
| 45 |
dict(name='div', attrs={'class': 'article'}), |
| 46 |
dict(name='div', attrs={'class': 'gallery clearfix'}), |
| 47 |
dict(name='div', attrs={'align': 'justify'}), |
| 48 |
] |
| 49 |
|
| 50 |
remove_tags = [ |
| 51 |
dict(name='p', attrs={'class': ['info']}), |
| 52 |
dict(name='table', attrs={'class': ['connect_widget_interactive_area']}), |
| 53 |
dict(name='span', attrs={'class': ['photo']}), |
| 54 |
dict(name='div', attrs={'class': ['counter']}), |
| 55 |
dict(name='div', attrs={'class': ['carousel']}), |
| 56 |
dict(name='div', attrs={'class': ['jcarousel-container jcarousel-container-horizontal']}), # noqa: E501 |
| 57 |
] |
| 58 |
|
| 59 |
remove_tags_after = [dict(name='table', attrs={'class': ['connect_widget_interactive_area']})] |
| 60 |
|
| 61 |
feeds = [('Feeds', 'http://www.onemagazine.ro/rss')] |
| 62 |
|
| 63 |
def preprocess_html(self, soup): |
| 64 |
return self.adeify_images(soup) |