2018-02-13 12:43:37 +01: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;
|
2018-02-13 12:43:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function applyBlacklist(o) {
|
2019-10-24 21:25:19 +02:00
|
|
|
return !utils.isOneOf(o.title, config.blacklist);
|
2018-02-13 12:43:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const neubauKompass = {
|
2019-10-24 21:25:19 +02:00
|
|
|
name: 'neubauKompass',
|
|
|
|
|
enabled: config.sources.neubauKompass.enabled,
|
|
|
|
|
url: config.sources.neubauKompass.url,
|
|
|
|
|
crawlContainer: '.row article',
|
|
|
|
|
crawlFields: {
|
|
|
|
|
id: '@id',
|
|
|
|
|
title: 'div.p-2 > a@title | removeNewline | trim',
|
|
|
|
|
link: 'div.p-2 > a@href',
|
|
|
|
|
address: 'div.p-2 > p | removeNewline | trim'
|
|
|
|
|
},
|
|
|
|
|
paginate: '.numbered-pager__bottom .numbered-pager--info li:nth-child(2) a@href',
|
|
|
|
|
normalize: normalize,
|
|
|
|
|
filter: applyBlacklist
|
2018-02-13 12:43:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = new Fredy(neubauKompass);
|