| 1 |
__license__ = 'GPL v3' |
| 2 |
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' |
| 3 |
|
| 4 |
''' |
| 5 |
Fetch heise. |
| 6 |
''' |
| 7 |
|
| 8 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 9 |
|
| 10 |
|
| 11 |
class heiseDe(BasicNewsRecipe): |
| 12 |
title = 'heise' |
| 13 |
description = 'Computernews from Germany' |
| 14 |
__author__ = 'Oliver Niesner' |
| 15 |
use_embedded_content = False |
| 16 |
language = 'de' |
| 17 |
timefmt = ' [%d %b %Y]' |
| 18 |
max_articles_per_feed = 40 |
| 19 |
no_stylesheets = True |
| 20 |
|
| 21 |
extra_css = ''' |
| 22 |
.bild_links, .bild_bu_links { |
| 23 |
float:left; |
| 24 |
line-height:105%; |
| 25 |
margin:12px 1.4em 12px 0; |
| 26 |
} |
| 27 |
|
| 28 |
.bild_rechts, .bild_bu { |
| 29 |
float:right; |
| 30 |
line-height:105%; |
| 31 |
margin:12px 0 12px 1em; |
| 32 |
text-align:right; |
| 33 |
} |
| 34 |
|
| 35 |
.bild_zentriert { |
| 36 |
clear:both; |
| 37 |
line-height:105%; |
| 38 |
margin:.2em auto; |
| 39 |
text-align:center; |
| 40 |
} |
| 41 |
|
| 42 |
span.bild_links, span.bild_rechts, span.bild_zentriert { |
| 43 |
display:block; |
| 44 |
} |
| 45 |
''' |
| 46 |
|
| 47 |
remove_tags = [ |
| 48 |
dict(id='navi_bottom'), |
| 49 |
dict(id='software_tabbox'), |
| 50 |
dict(id='heisetopnavi_sub_container'), |
| 51 |
dict(id='navi_login'), |
| 52 |
dict(id='heisetopnavi_search'), |
| 53 |
dict(id='themen_aktuell'), |
| 54 |
dict(id='navi_top'), |
| 55 |
dict(id='logo_bereich'), |
| 56 |
dict(name='div', attrs={'class': 'news_logo'}), |
| 57 |
dict(name='div', attrs={'class': 'heisetopnavi_header'}), |
| 58 |
dict(name='p', attrs={'class': 'teasermitbildundtext'}), |
| 59 |
dict(name='div', attrs={'class': 'news_foren'}), |
| 60 |
dict(name='p', attrs={'class': 'news_navi'}), |
| 61 |
] |
| 62 |
|
| 63 |
remove_tags_after = [dict(name='div', attrs={'class': 'news_foren'})] |
| 64 |
|
| 65 |
feeds = [ |
| 66 |
('heise online', 'http://www.heise.de/newsticker/heise.rdf'), |
| 67 |
('heise Developer', 'http://www.heise.de/developer/rss/news-atom.xml'), |
| 68 |
('heise open', 'http://www.heise.de/open/news/news-atom.xml'), |
| 69 |
] |
| 70 |
|
| 71 |
def get_article_url(self, article): |
| 72 |
return article.link + '&view=print' |