mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update various Polish news sources
Merge branch 'master' of https://github.com/t3d/calibre
This commit is contained in:
commit
9fe0aa41da
@ -1,18 +0,0 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
import re
|
||||
class Astronomia_pl(BasicNewsRecipe):
|
||||
title = u'Astronomia.pl'
|
||||
__author__ = 'fenuks'
|
||||
description = u'Astronomia.pl jest edukacyjnym portalem skierowanym do uczniów, studentów i miłośników astronomii. Przedstawiamy gwiazdy, planety, galaktyki, czarne dziury i wiele innych tajemnic Wszechświata.'
|
||||
masthead_url = 'http://www.astronomia.pl/grafika/logo.gif'
|
||||
cover_url = 'http://www.astronomia.pl/grafika/logo.gif'
|
||||
category = 'astronomy, science'
|
||||
language = 'pl'
|
||||
oldest_article = 8
|
||||
max_articles_per_feed = 100
|
||||
extra_css='#h2 {font-size: 18px;}'
|
||||
no_stylesheets=True
|
||||
preprocess_regexps = [(re.compile(ur'<b>Przeczytaj także:.*?</BODY>', re.DOTALL), lambda match: '</BODY>') ]
|
||||
remove_tags_before=dict(name='div', attrs={'id':'a1'})
|
||||
keep_only_tags=[dict(name='div', attrs={'id':['a1', 'h2']})]
|
||||
feeds = [(u'Wiadomości z astronomii i astronautyki', u'http://www.astronomia.pl/rss/')]
|
@ -3,7 +3,7 @@ import re
|
||||
|
||||
class Dobreprogramy_pl(BasicNewsRecipe):
|
||||
title = 'Dobreprogramy.pl'
|
||||
__author__ = 'fenuks'
|
||||
__author__ = u'fenuks & Tomasz Długosz'
|
||||
__licence__ ='GPL v3'
|
||||
category = 'IT'
|
||||
masthead_url='http://static.dpcdn.pl/css/Black/Images/header_logo_napis_fullVersion.png'
|
||||
@ -18,9 +18,9 @@ class Dobreprogramy_pl(BasicNewsRecipe):
|
||||
max_articles_per_feed = 100
|
||||
remove_attrs = ['style', 'width', 'height']
|
||||
preprocess_regexps = [(re.compile(ur'<div id="\S+360pmp4">Twoja przeglądarka nie obsługuje Flasha i HTML5 lub wyłączono obsługę JavaScript...</div>'), lambda match: '') ]
|
||||
keep_only_tags = [dict(attrs={'class':['entry single']}), dict(id='phContent_divArticle')]
|
||||
remove_tags = [dict(attrs={'class':['newsOptions', 'noPrint', 'komentarze', 'tags font-heading-master', 'social nested-grid grid-margin-px15-top clearfix no-mobile', 'page-info text-h4 font-heading grid-margin-px15-top color-annotation clearfix']}), dict(id='komentarze'), dict(name='iframe')]
|
||||
#remove_tags = [dict(name='div', attrs={'class':['komentarze', 'block', 'portalInfo', 'menuBar', 'topBar']})]
|
||||
keep_only_tags = [dict(name='h1'), dict(attrs={'class':['entry single']}), dict(id='phContent_divArticle')]
|
||||
remove_tags = [dict(attrs={'class':['newsOptions', 'noPrint', 'komentarze', 'tags font-heading-master', 'social nested-grid grid-margin-px15-top clearfix no-mobile', 'page-info text-h4 font-heading grid-margin-px15-top color-annotation clearfix', 'series grid-margin-px30-top']}), dict(id='komentarze'), dict(id='phContent_ctl02_sBreadcrumb'), dict(name='iframe')]
|
||||
|
||||
feeds = [(u'Aktualności', 'http://feeds.feedburner.com/dobreprogramy/Aktualnosci'),
|
||||
('Blogi', 'http://feeds.feedburner.com/dobreprogramy/BlogCzytelnikow')]
|
||||
|
||||
@ -37,3 +37,7 @@ class Dobreprogramy_pl(BasicNewsRecipe):
|
||||
if not r.string:
|
||||
r.extract()
|
||||
return soup
|
||||
|
||||
extra_css = '''
|
||||
h1 { font-size:130% }
|
||||
'''
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 546 B |
Binary file not shown.
Before Width: | Height: | Size: 215 B |
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = u'2010-2013, Tomasz Dlugosz <tomek3d@gmail.com>'
|
||||
__copyright__ = u'2010-2015, Tomasz Dlugosz <tomek3d@gmail.com>'
|
||||
'''
|
||||
fakty.interia.pl
|
||||
'''
|
||||
@ -29,7 +29,7 @@ class InteriaFakty(BasicNewsRecipe):
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='h1'),
|
||||
dict(name='div', attrs={'class': ['lead textContent', 'text textContent', 'source']})]
|
||||
dict(name='div', attrs={'class': ['lead textContent fontSize-medium', 'text textContent fontSize-medium', 'source']})]
|
||||
|
||||
remove_tags = [dict(name='div', attrs={'class':['embed embedAd', 'REMOVE', 'boxHeader']})]
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = 'MrStefan, teepel'
|
||||
|
||||
'''
|
||||
www.mojegotowanie.pl
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class mojegotowanie(BasicNewsRecipe):
|
||||
title = u'Moje Gotowanie'
|
||||
__author__ = 'MrStefan <mrstefaan@gmail.com>, teepel <teepel44@gmail.com>'
|
||||
language = 'pl'
|
||||
description =u'Gotowanie to Twoja pasja? Uwielbiasz sałatki? Lubisz grillować? Przepisy kulinarne doskonałe na wszystkie okazje znajdziesz na www.mojegotowanie.pl.'
|
||||
masthead_url='http://www.mojegotowanie.pl/extension/selfstart/design/self/images/top_c2.gif'
|
||||
cover_url = 'http://www.mojegotowanie.pl/extension/selfstart/design/self/images/mgpl/mojegotowanie.gif'
|
||||
remove_empty_feeds= True
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
remove_javascript=True
|
||||
no_stylesheets=True
|
||||
|
||||
keep_only_tags =[]
|
||||
keep_only_tags.append(dict(name='div', attrs={'class' : 'content'}))
|
||||
|
||||
feeds = [(u'Artykuły', u'http://mojegotowanie.pl/rss/feed/artykuly'),
|
||||
(u'Przepisy', u'http://mojegotowanie.pl/rss/feed/przepisy')]
|
||||
|
||||
def parse_feeds(self):
|
||||
feeds = BasicNewsRecipe.parse_feeds(self)
|
||||
for feed in feeds:
|
||||
for article in feed.articles[:]:
|
||||
if 'film' in article.title:
|
||||
feed.articles.remove(article)
|
||||
return feeds
|
||||
|
||||
def get_article_url(self, article):
|
||||
link = article.get('link')
|
||||
if 'Clayout0Cset0Cprint0' in link:
|
||||
return link
|
||||
|
||||
def print_version(self, url):
|
||||
segment = url.split('/')
|
||||
URLPart = segment[-2]
|
||||
URLPart = URLPart.replace('0L0Smojegotowanie0Bpl0Clayout0Cset0Cprint0C', '/')
|
||||
URLPart = URLPart.replace('0I', '_')
|
||||
URLPart = URLPart.replace('0C', '/')
|
||||
return 'http://www.mojegotowanie.pl/layout/set/print' + URLPart
|
Loading…
x
Reference in New Issue
Block a user