Files
fredy/lib/provider/neubauKompass.js
Christian Kellner 770d30af95 Concurrent-Jobs (#7)
Fredy 2.0.0 introduces the concept of search jobs. You can now configure multiple of these jobs running in the same instance of Fredy. Also a new API has been created 🎉
2020-02-26 09:05:20 +01:00

38 lines
870 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 = {
enabled: null,
url: null,
crawlContainer: '.row 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;
};
//must match the id of the source given in the config!
exports.id = () => 'neubauKompass';
exports.config = config;