This commit is contained in:
Kovid Goyal 2017-05-24 17:38:08 +05:30
commit ce02e0530a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -17,15 +17,16 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
__license__ = 'GPL v3'
__copyright__ = ('2014 - 2017 Martin Račák <martin.racak@riseup.net>,'
'2011 Miroslav Vasko <zemiak@gmail.com>')
import re import re
from calibre import strftime from calibre import strftime
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
__copyright__ = (
'2014 - 2017 Martin Račák <martin.racak@riseup.net>,'
'2011 Miroslav Vasko <zemiak@gmail.com>')
__license__ = 'GPL-3.0+'
class Tyzden(BasicNewsRecipe): class Tyzden(BasicNewsRecipe):
title = u'.týždeň' title = u'.týždeň'
@ -40,9 +41,14 @@ class Tyzden(BasicNewsRecipe):
issue_url = 'http://www.tyzden.sk/casopis/' issue_url = 'http://www.tyzden.sk/casopis/'
keep_only_tags = [ keep_only_tags = [
dict(name='div', attrs={'class': 'section__content section__content--archive'}), {
dict(name='article', attrs={'class': re.compile(r'\barticle\b')}), 'name': 'div',
] 'attrs': {
'class': 'section__content section__content--archive'}},
{
'name': 'article',
'attrs': {
'class': re.compile(r'\barticle\b')}}, ]
extra_css = """.theme-highlight { extra_css = """.theme-highlight {
color: #999; color: #999;
@ -59,12 +65,15 @@ class Tyzden(BasicNewsRecipe):
display: inline; display: inline;
} }
.article__image-credit { .article__image-credit,
.content-photo__image-credit {
display: block;
font: 12px "TheSerifSemiLight", arial; font: 12px "TheSerifSemiLight", arial;
text-transform: uppercase; text-transform: uppercase;
} }
.article__image-title { .article__image-title,
.image-title {
padding-top: 2px; padding-top: 2px;
padding-bottom: 2px; padding-bottom: 2px;
margin: 0; margin: 0;
@ -109,11 +118,10 @@ class Tyzden(BasicNewsRecipe):
article = { article = {
'title': article_title, 'title': article_title,
'url': article_link['href'], 'url': article_link['href'],
'date': strftime(' %a, %d %b') 'date': strftime(' %a, %d %b')}
}
if not feeds: if not feeds:
# First cycle iteration. # First iteration.
feeds.append((section, [article])) feeds.append((section, [article]))
continue continue