| 1 |
__license__ = 'GPL v3' |
| 2 |
import re |
| 3 |
|
| 4 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 5 |
|
| 6 |
|
| 7 |
class AlejaKomiksu(BasicNewsRecipe): |
| 8 |
title = 'Aleja Komiksu' |
| 9 |
__author__ = 'fenuks' |
| 10 |
description = 'Serwis poświęcony komiksom. Najnowsze wieści, recenzje, artykuły, wywiady, galerie, komiksy online, konkursy, linki, baza komiksów online.' |
| 11 |
category = 'comics' |
| 12 |
language = 'pl' |
| 13 |
extra_css = 'ul {list-style-type: none;} .gfx_news {float: right;}' |
| 14 |
cover_url = 'http://www.alejakomiksu.com/gfx/build/logo.png' |
| 15 |
masthead_url = 'http://www.alejakomiksu.com/gfx/build/logo.png' |
| 16 |
use_embedded_content = False |
| 17 |
oldest_article = 7 |
| 18 |
max_articles_per_feed = 100 |
| 19 |
no_stylesheets = True |
| 20 |
remove_empty_feeds = True |
| 21 |
remove_javascript = True |
| 22 |
remove_attributes = ['style', 'font'] |
| 23 |
ignore_duplicate_articles = {'title', 'url'} |
| 24 |
|
| 25 |
keep_only_tags = dict(attrs={'class': ['akNews__header', 'akNews__body']}) |
| 26 |
|
| 27 |
feeds = [('Wiadomości', 'http://www.alejakomiksu.com/rss.php5')] |
| 28 |
|
| 29 |
def skip_ad_pages(self, soup): |
| 30 |
tag = soup.find(attrs={'class': 'rodzaj'}) |
| 31 |
if tag and tag.a.string.lower().strip() == 'recenzje': |
| 32 |
link = soup.find(text=re.compile(r'recenzuje')) |
| 33 |
if link: |
| 34 |
return self.index_to_soup(link.parent['href'], raw=True) |