calibre/recipes/national_post.recipe
Kovid Goyal 29cd8d64ea
Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30

33 lines
799 B
Python

#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from calibre.web.feeds.recipes import BasicNewsRecipe
def classes(classes):
q = frozenset(classes.split(' '))
return dict(attrs={
'class': lambda x: x and frozenset(x.split()).intersection(q)})
class NationalPost(BasicNewsRecipe):
title = 'National Post'
__author__ = 'Kovid Goyal'
description = 'Canadian national newspaper'
timefmt = ' [%d %b, %Y]'
language = 'en_CA'
no_stylesheets = True
oldest_article = 1.5
use_embedded_content = False
keep_only_tags = [
dict(itemprop='headline'),
classes('featured-image'),
dict(itemprop='articleBody'),
]
feeds = ['http://nationalpost.com/rss']