Files
fredy/lib/provider/neubauKompass.js
Christian Kellner b2847f6834 UI (#15)
Adding new Admin UI. Updating Fredy to V3.0.0 as it has been a large rewrite. Thanks for all contributions and help on the way!
2021-01-21 16:09:23 +01:00

40 lines
936 B
JavaScript
Executable File

const utils = require('../utils');
let appliedBlackList = [];
function normalize(o) {
return o;
}
function applyBlacklist(o) {
return !utils.isOneOf(o.title, appliedBlackList);
}
const config = {
url: null,
crawlContainer: '.nbk-container >div article',
crawlFields: {
id: '@id',
title: 'div.nbk-p-2 > h3 a@title | removeNewline | trim',
link: 'div.nbk-p-2 > h3 > a@href',
address: 'div.nbk-p-2 > p | removeNewline | trim',
},
paginate: '.numbered-pager__bottom .numbered-pager--info li:nth-child(2) a@href',
normalize: normalize,
filter: applyBlacklist,
};
exports.init = (sourceConfig, blacklist) => {
config.enabled = sourceConfig.enabled;
config.url = sourceConfig.url;
appliedBlackList = blacklist || [];
};
exports.metaInformation = {
name: 'Neubau Kompass',
baseUrl: 'https://www.neubaukompass.de/',
id: __filename.slice(__dirname.length + 1, -3),
};
exports.config = config;