2019-06-10 14:40:28 +02:00
|
|
|
const config = require('../../conf/config.json');
|
|
|
|
|
const Fredy = require('../fredy');
|
|
|
|
|
const utils = require('../utils');
|
|
|
|
|
|
|
|
|
|
function normalize(o) {
|
2019-10-24 21:25:19 +02:00
|
|
|
return o;
|
2019-06-10 14:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function applyBlacklist(o) {
|
2019-10-24 21:25:19 +02:00
|
|
|
const titleNotBlacklisted = !utils.isOneOf(o.title, config.blacklist);
|
|
|
|
|
const descNotBlacklisted = !utils.isOneOf(o.description, config.blacklist);
|
2019-06-10 14:40:28 +02:00
|
|
|
|
2019-10-24 21:25:19 +02:00
|
|
|
return titleNotBlacklisted && descNotBlacklisted;
|
2019-06-10 14:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const wgGesucht = {
|
2019-10-24 21:25:19 +02:00
|
|
|
name: 'wgGesucht',
|
|
|
|
|
enabled: config.sources.wgGesucht.enabled,
|
|
|
|
|
url: config.sources.wgGesucht.url,
|
|
|
|
|
crawlContainer: '#main_column .panel:not(.display-none):not(.noprint)',
|
|
|
|
|
crawlFields: {
|
|
|
|
|
id: '@data-id',
|
|
|
|
|
details: '.detail-size-price-wrapper .detailansicht |removeNewline |trim',
|
|
|
|
|
title: '.headline .detailansicht |removeNewline |trim',
|
|
|
|
|
description: '.list-details-panel-inner p |removeNewline |trim',
|
|
|
|
|
link: '.headline .detailansicht@href'
|
|
|
|
|
},
|
|
|
|
|
paginate: '.pagination-sm:first a:last@href',
|
|
|
|
|
normalize: normalize,
|
|
|
|
|
filter: applyBlacklist
|
2019-06-10 14:40:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = new Fredy(wgGesucht);
|