mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Updated bash.org.pl and dobreprogamy.pl
This commit is contained in:
parent
3ec16fe758
commit
bdefb6b03c
@ -1,15 +1,52 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
class Bash_org_pl(BasicNewsRecipe):
|
class Bash_org_pl(BasicNewsRecipe):
|
||||||
title = u'Bash.org.pl'
|
title = u'Bash.org.pl'
|
||||||
__author__ = 'fenuks'
|
__author__ = 'fenuks'
|
||||||
description = 'Bash.org.pl - funny quotations from IRC discussions'
|
description = 'Bash.org.pl - funny quotations from IRC discussions'
|
||||||
category = 'funny quotations, humour'
|
category = 'funny quotations, humour'
|
||||||
language = 'pl'
|
language = 'pl'
|
||||||
oldest_article = 15
|
|
||||||
cover_url = u'http://userlogos.org/files/logos/dzikiosiol/none_0.png'
|
cover_url = u'http://userlogos.org/files/logos/dzikiosiol/none_0.png'
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 50
|
||||||
no_stylesheets= True
|
no_stylesheets= True
|
||||||
keep_only_tags= [dict(name='div', attrs={'class':'quote post-content post-body'})]
|
keep_only_tags= [dict(name='a', attrs={'class':'qid click'}),
|
||||||
feeds = [(u'Cytaty', u'http://bash.org.pl/rss')]
|
dict(name='div', attrs={'class':'quote post-content post-body'})]
|
||||||
|
|
||||||
|
|
||||||
|
def latest_articles(self):
|
||||||
|
articles = []
|
||||||
|
soup=self.index_to_soup(u'http://bash.org.pl/latest/')
|
||||||
|
#date=soup.find('div', attrs={'class':'right'}).string
|
||||||
|
tags=soup.findAll('a', attrs={'class':'qid click'})
|
||||||
|
for a in tags:
|
||||||
|
title=a.string
|
||||||
|
url='http://bash.org.pl' +a['href']
|
||||||
|
articles.append({'title' : title,
|
||||||
|
'url' : url,
|
||||||
|
'date' : '',
|
||||||
|
'description' : ''
|
||||||
|
})
|
||||||
|
return articles
|
||||||
|
|
||||||
|
|
||||||
|
def random_articles(self):
|
||||||
|
articles = []
|
||||||
|
for i in range(self.max_articles_per_feed):
|
||||||
|
soup=self.index_to_soup(u'http://bash.org.pl/random/')
|
||||||
|
#date=soup.find('div', attrs={'class':'right'}).string
|
||||||
|
url=soup.find('a', attrs={'class':'qid click'})
|
||||||
|
title=url.string
|
||||||
|
url='http://bash.org.pl' +url['href']
|
||||||
|
articles.append({'title' : title,
|
||||||
|
'url' : url,
|
||||||
|
'date' : '',
|
||||||
|
'description' : ''
|
||||||
|
})
|
||||||
|
return articles
|
||||||
|
|
||||||
|
|
||||||
|
def parse_index(self):
|
||||||
|
feeds = []
|
||||||
|
feeds.append((u"Najnowsze", self.latest_articles()))
|
||||||
|
feeds.append((u"Losowe", self.random_articles()))
|
||||||
|
return feeds
|
@ -1,5 +1,5 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
import re
|
||||||
|
|
||||||
class Dobreprogramy_pl(BasicNewsRecipe):
|
class Dobreprogramy_pl(BasicNewsRecipe):
|
||||||
title = 'Dobreprogramy.pl'
|
title = 'Dobreprogramy.pl'
|
||||||
@ -15,6 +15,7 @@ class Dobreprogramy_pl(BasicNewsRecipe):
|
|||||||
extra_css = '.title {font-size:22px;}'
|
extra_css = '.title {font-size:22px;}'
|
||||||
oldest_article = 8
|
oldest_article = 8
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
|
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: '') ]
|
||||||
remove_tags = [dict(name='div', attrs={'class':['komentarze', 'block', 'portalInfo', 'menuBar', 'topBar']})]
|
remove_tags = [dict(name='div', attrs={'class':['komentarze', 'block', 'portalInfo', 'menuBar', 'topBar']})]
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':['mainBar', 'newsContent', 'postTitle title', 'postInfo', 'contentText', 'content']})]
|
keep_only_tags = [dict(name='div', attrs={'class':['mainBar', 'newsContent', 'postTitle title', 'postInfo', 'contentText', 'content']})]
|
||||||
feeds = [(u'Aktualności', 'http://feeds.feedburner.com/dobreprogramy/Aktualnosci'),
|
feeds = [(u'Aktualności', 'http://feeds.feedburner.com/dobreprogramy/Aktualnosci'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user