mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-09-29 15:31:08 -04:00
63 lines
2.2 KiB
Python
63 lines
2.2 KiB
Python
#!/usr/bin/env python2
|
|
|
|
__license__ = 'GPL v3'
|
|
__copyright__ = u'2011, Vroo <vroobelek@iq.pl>'
|
|
__author__ = u'Vroo'
|
|
'''
|
|
gazetaprawna.pl
|
|
'''
|
|
|
|
from calibre.web.feeds.news import BasicNewsRecipe
|
|
|
|
|
|
class gazetaprawna(BasicNewsRecipe):
|
|
version = 1
|
|
title = u'Gazeta Prawna'
|
|
__author__ = u'Vroo'
|
|
publisher = u'Infor Biznes'
|
|
oldest_article = 1
|
|
max_articles_per_feed = 20
|
|
no_stylesheets = True
|
|
remove_javascript = True
|
|
description = 'Polski dziennik gospodarczy'
|
|
language = 'pl'
|
|
encoding = 'utf-8'
|
|
ignore_duplicate_articles = {'title', 'url'}
|
|
|
|
remove_tags_after = [
|
|
dict(name='div', attrs={'class': ['data-art']})
|
|
]
|
|
remove_tags = [
|
|
dict(name='div', attrs={'class': ['dodatki_artykulu', 'data-art']})
|
|
]
|
|
|
|
feeds = [
|
|
(u'Z ostatniej chwili', u'http://rss.gazetaprawna.pl/GazetaPrawna'),
|
|
(u'Biznes i prawo gospodarcze', u'http://biznes.gazetaprawna.pl/rss.xml'),
|
|
(u'Prawo i wymiar sprawiedliwo\u015bci',
|
|
u'http://prawo.gazetaprawna.pl/rss.xml'),
|
|
(u'Praca i ubezpieczenia', u'http://praca.gazetaprawna.pl/rss.xml'),
|
|
(u'Podatki i rachunkowo\u015b\u0107',
|
|
u'http://podatki.gazetaprawna.pl/rss.xml')
|
|
]
|
|
|
|
def print_version(self, url):
|
|
url = url.replace('wiadomosci/artykuly', 'drukowanie')
|
|
url = url.replace('artykuly', 'drukowanie')
|
|
url = url.replace('porady', 'drukowanie')
|
|
url = url.replace('wywiady', 'drukowanie')
|
|
url = url.replace('orzeczenia', 'drukowanie')
|
|
url = url.replace('galeria', 'drukowanie')
|
|
url = url.replace('komentarze', 'drukowanie')
|
|
url = url.replace('biznes.gazetaprawna', 'www.gazetaprawna')
|
|
url = url.replace('podatki.gazetaprawna', 'www.gazetaprawna')
|
|
url = url.replace('prawo.gazetaprawna', 'www.gazetaprawna')
|
|
url = url.replace('praca.gazetaprawna', 'www.gazetaprawna')
|
|
return url
|
|
|
|
def get_cover_url(self):
|
|
soup = self.index_to_soup(
|
|
'http://www.egazety.pl/infor/e-wydanie-dziennik-gazeta-prawna.html')
|
|
self.cover_url = soup.find('p', attrs={'class': 'covr'}).a['href']
|
|
return getattr(self, 'cover_url', self.cover_url)
|