4
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
8
from calibre.web.feeds.news import BasicNewsRecipe
9
from calibre.ebooks.BeautifulSoup import Tag
11
class GazetvanAntwerpen(BasicNewsRecipe):
12
title = 'Gazet van Antwerpen'
13
__author__ = 'Darko Miletic'
14
description = 'News from Belgium in Dutch'
15
publisher = 'Gazet van Antwerpen'
16
category = 'news, politics, Belgium'
18
max_articles_per_feed = 100
20
use_embedded_content = False
27
'--comment' , description
28
, '--category' , category
29
, '--publisher', publisher
32
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "'
34
keep_only_tags = [dict(name='div', attrs={'id':'article'})]
36
dict(name=['embed','object'])
37
, dict (name='div',attrs={'class':['note NotePortrait','note']})
39
remove_tags_after = dict(name='span', attrs={'class':'author'})
42
(u'Overzicht & Blikvanger', u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/overview/overzicht' )
43
,(u'Stad & Regio' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/stadenregio' )
44
,(u'Economie' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/economie' )
45
,(u'Binnenland' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/binnenland' )
46
,(u'Buitenland' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/buitenland' )
47
,(u'Media & Cultur' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/mediaencultuur')
48
,(u'Wetenschap' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/mediaencultuur')
49
,(u'Sport' , u'http://www.gva.be/syndicationservices/artfeedservice.svc/rss/mostrecent/sport' )
52
def preprocess_html(self, soup):
53
del soup.body['onload']
54
for item in soup.findAll(style=True):
56
soup.html['lang'] = self.lang
57
soup.html['dir' ] = self.direction
58
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
59
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
60
soup.head.insert(0,mlang)
61
soup.head.insert(1,mcharset)