| 1 |
import re |
| 2 |
|
| 3 |
__license__ = 'GPL v3' |
| 4 |
__copyright__ = '2011, Rasmus Lauritsen <rasmus at lauritsen.info>' |
| 5 |
''' |
| 6 |
version2.dk |
| 7 |
''' |
| 8 |
|
| 9 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 10 |
|
| 11 |
|
| 12 |
class version2(BasicNewsRecipe): |
| 13 |
title = 'Version2.dk' |
| 14 |
__author__ = 'Rasmus Lauritsen' |
| 15 |
description = 'IT News' |
| 16 |
publisher = 'version2.dk' |
| 17 |
category = 'news, IT, hardware, software, Denmark' |
| 18 |
oldest_article = 14 |
| 19 |
max_articles_per_feed = 25 |
| 20 |
no_stylesheets = False |
| 21 |
remove_empty_feeds = True |
| 22 |
use_embedded_content = False |
| 23 |
encoding = 'utf-8' |
| 24 |
language = 'da' |
| 25 |
|
| 26 |
extra_css = '.article { font-weight: normal; }' |
| 27 |
|
| 28 |
preprocess_regexps = [(re.compile(r'</?a[^>]*>'), lambda match: ''), (re.compile(r'<span[^>]*article-link-id.*?<br\s*\/?><br\s*\/?>'), lambda match: '')] |
| 29 |
|
| 30 |
keep_only_tags = [ |
| 31 |
dict(name='div', attrs={'id': 'article-page'}), |
| 32 |
dict(name='section', attrs={'class': 'byline'}), |
| 33 |
dict(name='section', attrs={'class': 'body'}), |
| 34 |
] |
| 35 |
|
| 36 |
remove_tags = [ |
| 37 |
dict(name='p', attrs={'class': 'meta links'}), |
| 38 |
dict(name='div', attrs={'class': 'float-right'}), |
| 39 |
dict(name='span', attrs={'class': 'article-link-id'}), |
| 40 |
dict(name='section', attrs={'class': 'social-tools-pane'}), |
| 41 |
dict(name='section', attrs={'class': 'article-timeline'}), |
| 42 |
dict(name='div', attrs={'id': 'mini-panel-comments_and_form'}), |
| 43 |
dict(name='div', attrs={'class': 'related-articles top-three'}), |
| 44 |
dict(name='div', attrs={'id': 'mini-panel-jobfinder_1'}), |
| 45 |
dict(name='section', attrs={'id': 'mini-panel-frontpage_debat_zone'}), |
| 46 |
dict(name='div', attrs={'class': 'panel-panel panel-col-center grid w4'}), |
| 47 |
dict(name='section', attrs={'class': 'short-list sidebar most-rate-up'}), |
| 48 |
dict(name='section', attrs={'class': 'short-list sidebar debat-pane most-comment-lists'}), |
| 49 |
dict(name='section', attrs={'class': 'short-list sidebar most-controversial'}), |
| 50 |
dict(name='div', attrs={'id': 'mini-panel-related_branch_news'}), |
| 51 |
dict(name='div', attrs={'class': 'items-pane pr-pane'}), |
| 52 |
dict(name='section', attrs={'id': 'mini-panel-jobfinder_front'}), |
| 53 |
dict(name='section', attrs={'class': 'item-news'}), |
| 54 |
dict(name='section', attrs={'class': 'jobs-list'}), |
| 55 |
dict(name='footer', attrs={'id': 'footer'}), |
| 56 |
dict(name='section', attrs={'class': 'banner'}), |
| 57 |
dict(name='div', attrs={'class': 'fast-track-frontpage'}), |
| 58 |
dict(name='a', attrs={'class': 'byline-comments'}), |
| 59 |
] |
| 60 |
|
| 61 |
feeds = [ |
| 62 |
('Seneste nyheder', 'https://www.version2.dk/it-nyheder/rss'), |
| 63 |
('Seneste blogs', 'https://www.version2.dk/blogs/rss'), |
| 64 |
('Seneste kommentarer', 'https://www.version2.dk/debat/rss'), |
| 65 |
] |