| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class ESO(BasicNewsRecipe): |
| 5 |
title = 'ESO PL' |
| 6 |
__author__ = 'fenuks' |
| 7 |
description = 'ESO, Europejskie Obserwatorium Południowe, buduje i obsługuje najbardziej zaawansowane naziemne teleskopy astronomiczne na świecie' |
| 8 |
category = 'astronomy' |
| 9 |
language = 'pl' |
| 10 |
oldest_article = 7 |
| 11 |
max_articles_per_feed = 100 |
| 12 |
no_stylesheets = True |
| 13 |
remove_empty_feeds = True |
| 14 |
use_embedded_content = False |
| 15 |
cover_url = 'https://www.eso.org/public/archives/logos/medium/eso-logo-black-outline.jpg' |
| 16 |
keep_only_tags = [ |
| 17 |
dict(attrs={'class': 'subcl'}), |
| 18 |
dict(name='div', attrs={'class': 'col-md-9 left-column'}), |
| 19 |
] |
| 20 |
remove_tags = [dict(id='lang_row'), dict(attrs={'class': ['pr_typeid', 'pr_news_feature_link', 'outreach_usage', 'hidden']})] |
| 21 |
feeds = [ |
| 22 |
('Wiadomo\u015bci', 'http://www.eso.org/public/poland/news/feed/'), |
| 23 |
('Og\u0142oszenia', 'http://www.eso.org/public/poland/announcements/feed/'), |
| 24 |
('Zdj\u0119cie tygodnia', 'http://www.eso.org/public/poland/images/potw/feed/'), |
| 25 |
] |
| 26 |
|
| 27 |
def preprocess_html(self, soup): |
| 28 |
for a in soup.findAll('a', href=True): |
| 29 |
if a['href'].startswith('/'): |
| 30 |
a['href'] = 'http://www.eso.org' + a['href'] |
| 31 |
return soup |