Le Peuple Breton by Lionel Plais

Merge branch 'master' of https://github.com/ILPlais/calibre
This commit is contained in:
Kovid Goyal 2018-11-11 10:31:07 +05:30
commit 4893d6f792
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -0,0 +1,44 @@
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe
# author: <lionel.plais@ilp-web.net>
class LePeupleBreton(BasicNewsRecipe):
title = 'Le Peuple Breton'
__author__ = 'Lionel Plais'
description = u'Aujourd\'hui, être libre c\'est être informé'
oldest_article = 90
language = 'fr'
cover_img_url = 'http://lepeuplebreton.bzh/wp-content/uploads/2017/11/le-peuple-breton-logo.jpg'
masthead_url = cover_img_url
remove_javascript = True
no_stylesheets = True
keep_only_tags = [
dict(name='article'),
]
remove_tags = [
dict(name='div', attrs={'class': ['share-post', 'juiz_sps_links', 'counters_both', 'juiz_sps_displayed_bottom']}),
]
feeds = [
(u'À la Une', u'http://lepeuplebreton.bzh/category/a-la-une/feed/'),
(u'Bretagne', u'http://lepeuplebreton.bzh/category/themes/bretagne/feed/'),
(u'France', u'http://lepeuplebreton.bzh/category/lieu/france/feed/'),
(u'International', u'http://lepeuplebreton.bzh/category/lieu/international-fr/feed/'),
(u'Point de vue', u'http://lepeuplebreton.bzh/category/themes/point-de-vue/feed/'),
(u'Économie', u'https://lepeuplebreton.bzh/category/themes/economie/feed/'),
(u'Écologie', u'http://lepeuplebreton.bzh/category/themes/ecologie/feed/'),
(u'Santé', u'http://lepeuplebreton.bzh/category/themes/sante/feed/'),
(u'Culture & Sport', u'http://lepeuplebreton.bzh/category/themes/culture/feed/'),
]
def preprocess_html(self, soup):
for alink in soup.findAll('a'):
if alink.string is not None:
tstr = alink.string
alink.replaceWith(tstr)
return soup