mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Telepolis
This commit is contained in:
parent
0448865f31
commit
fbabeb1f59
@ -1,46 +1,20 @@
|
|||||||
# -*- coding: utf-8 -*-
|
#!/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
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
class TelepolisNews(BasicNewsRecipe):
|
class Telepolis(BasicNewsRecipe):
|
||||||
title = u'Telepolis'
|
title = 'Telepolis'
|
||||||
__author__ = 'syntaxis'
|
|
||||||
publisher = 'Heise Zeitschriften Verlag GmbH & Co KG'
|
|
||||||
description = 'News from Telepolis'
|
|
||||||
category = 'news'
|
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
recursion = 0
|
auto_cleanup = True
|
||||||
no_stylesheets = True
|
recursions = 10
|
||||||
encoding = "utf-8"
|
|
||||||
language = 'de'
|
language = 'de'
|
||||||
|
|
||||||
remove_empty_feeds = True
|
feeds = [
|
||||||
|
('Telepolis', 'https://www.heise.de/tp/news-atom.xml'),
|
||||||
keep_only_tags = [dict(name='div', attrs={'class': 'head'}), dict(
|
|
||||||
name='div', attrs={'class': 'leftbox'}), dict(name='td', attrs={'class': 'strict'})]
|
|
||||||
remove_tags = [dict(name='td', attrs={'class': 'blogbottom'}),
|
|
||||||
dict(name='div', attrs={'class': 'forum'}), dict(name='div', attrs={
|
|
||||||
'class': 'social'}), dict(name='div', attrs={'class': 'blog-letter p-news'}),
|
|
||||||
dict(name='div', attrs={'class': 'blog-sub'}),
|
|
||||||
dict(name='div', attrs={'class': 'version-div'}),
|
|
||||||
dict(name='div', attrs={'id': 'breadcrumb'}), dict(attrs={'class': 'tp-url'}),
|
|
||||||
dict(attrs={'class': 'blog-name entry_'})]
|
|
||||||
|
|
||||||
remove_tags_after = [dict(name='span', attrs={'class': ['breadcrumb']})]
|
|
||||||
|
|
||||||
feeds = [(u'News', u'http://www.heise.de/tp/news-atom.xml')]
|
|
||||||
|
|
||||||
html2lrf_options = [
|
|
||||||
'--comment', description, '--category', category, '--publisher', publisher
|
|
||||||
]
|
]
|
||||||
|
|
||||||
html2epub_options = 'publisher="' + publisher + \
|
def is_link_wanted(self, url, tag):
|
||||||
'"\ncomments="' + description + '"\ntags="' + category + '"'
|
return tag['class'] == 'seite_weiter'
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
|
||||||
mtag = '<meta http-equiv="Content-Type" content="text/html; charset=' + \
|
|
||||||
self.encoding + '">'
|
|
||||||
soup.head.insert(0, mtag)
|
|
||||||
return soup
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user