| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
__license__ = 'GPL v3' |
| 5 |
__copyright__ = 'Łukasz Grąbczewski 2012-2013' |
| 6 |
__version__ = '1.2' |
| 7 |
|
| 8 |
''' |
| 9 |
zw.com.pl |
| 10 |
''' |
| 11 |
|
| 12 |
import re |
| 13 |
|
| 14 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 15 |
|
| 16 |
|
| 17 |
class zyciewarszawy(BasicNewsRecipe): |
| 18 |
__author__ = 'Łukasz Grączewski' |
| 19 |
title = 'Życie Warszawy' |
| 20 |
description = 'Wiadomości z Warszawy' |
| 21 |
language = 'pl' |
| 22 |
publisher = 'Presspublica' |
| 23 |
publication_type = 'newspaper' |
| 24 |
masthead_url = 'http://www.zw.com.pl/static/img/logo_zw.gif' |
| 25 |
no_stylesheets = True |
| 26 |
remove_javascript = True |
| 27 |
use_embedded_content = False |
| 28 |
remove_empty_feeds = True |
| 29 |
|
| 30 |
oldest_article = 1.5 # last 36h |
| 31 |
max_articles_per_feed = 100 |
| 32 |
|
| 33 |
feeds = [('Najnowsze', 'http://www.zw.com.pl/rss/1.html')] |
| 34 |
|
| 35 |
keep_only_tags = [] |
| 36 |
keep_only_tags.append(dict(name='div', attrs={'id': 'storyp'})) |
| 37 |
|
| 38 |
remove_tags = [] |
| 39 |
remove_tags.append(dict(attrs={'class': 'author'})) |
| 40 |
remove_tags.append(dict(attrs={'class': 'more'})) |
| 41 |
remove_tags.append(dict(attrs={'class': 'clr'})) |
| 42 |
remove_tags.append(dict(attrs={'id': 'adk_0'})) |
| 43 |
remove_tags.append(dict(attrs={'id': 'adsense_0'})) |
| 44 |
remove_tags.append(dict(attrs={'id': 'share_bottom'})) |
| 45 |
remove_tags.append(dict(attrs={'id': 'copyright_law'})) |
| 46 |
|
| 47 |
preprocess_regexps = [(re.compile(r',3.jpg'), lambda m: ',2.jpg')] |
| 48 |
|
| 49 |
def print_version(self, url): |
| 50 |
url += '?print=tak' |
| 51 |
return url |