2023-03-13 13:42:43 +01:00
|
|
|
import utils from '../utils.js';
|
2020-02-26 09:05:20 +01:00
|
|
|
let appliedBlackList = [];
|
2018-02-13 12:43:37 +01:00
|
|
|
function normalize(o) {
|
2019-10-24 21:25:19 +02:00
|
|
|
return o;
|
2018-02-13 12:43:37 +01:00
|
|
|
}
|
|
|
|
|
function applyBlacklist(o) {
|
2020-02-26 09:05:20 +01:00
|
|
|
return !utils.isOneOf(o.title, appliedBlackList);
|
2018-02-13 12:43:37 +01:00
|
|
|
}
|
2020-02-26 09:05:20 +01:00
|
|
|
const config = {
|
|
|
|
|
url: null,
|
2020-06-22 09:29:32 +02:00
|
|
|
crawlContainer: '.nbk-container >div article',
|
2021-11-26 21:02:09 +01:00
|
|
|
sortByDateParam: 'Sortierung=Id&Richtung=DESC',
|
2019-10-24 21:25:19 +02:00
|
|
|
crawlFields: {
|
|
|
|
|
id: '@id',
|
2021-03-01 17:29:52 +01:00
|
|
|
title: 'a.nbk-truncate@title | removeNewline | trim',
|
|
|
|
|
link: 'a.nbk-truncate@href',
|
|
|
|
|
address: 'p.nbk-truncate | removeNewline | trim',
|
|
|
|
|
price: 'p.nbk-mb-0 | removeNewline | trim',
|
2019-10-24 21:25:19 +02:00
|
|
|
},
|
|
|
|
|
paginate: '.numbered-pager__bottom .numbered-pager--info li:nth-child(2) a@href',
|
|
|
|
|
normalize: normalize,
|
2020-06-22 09:29:32 +02:00
|
|
|
filter: applyBlacklist,
|
2018-02-13 12:43:37 +01:00
|
|
|
};
|
2023-03-13 13:42:43 +01:00
|
|
|
export const init = (sourceConfig, blacklist) => {
|
2020-02-26 09:05:20 +01:00
|
|
|
config.enabled = sourceConfig.enabled;
|
|
|
|
|
config.url = sourceConfig.url;
|
2021-01-21 16:09:23 +01:00
|
|
|
appliedBlackList = blacklist || [];
|
2020-02-26 09:05:20 +01:00
|
|
|
};
|
2023-03-13 13:42:43 +01:00
|
|
|
export const metaInformation = {
|
2021-01-21 16:09:23 +01:00
|
|
|
name: 'Neubau Kompass',
|
|
|
|
|
baseUrl: 'https://www.neubaukompass.de/',
|
2023-03-13 13:42:43 +01:00
|
|
|
id: 'neubauKompass',
|
2021-01-21 16:09:23 +01:00
|
|
|
};
|
2023-03-13 13:42:43 +01:00
|
|
|
export { config };
|