2021-01-21 16:09:23 +01:00
|
|
|
const { markdown2Html } = require('../../services/markdown');
|
|
|
|
|
|
2018-01-20 20:23:27 +01:00
|
|
|
/**
|
|
|
|
|
* simply prints out the found data to the console
|
2021-01-21 16:09:23 +01:00
|
|
|
* @param serviceName e.g immowelt
|
2018-02-06 13:57:32 +01:00
|
|
|
* @param newListings an array with newly found listings
|
2020-07-17 16:34:10 +02:00
|
|
|
* @param jobKey name of the current job that is being executed
|
2018-01-20 20:23:27 +01:00
|
|
|
*/
|
2021-01-21 16:09:23 +01:00
|
|
|
exports.send = ({ serviceName, newListings, jobKey }) => {
|
2020-02-26 09:05:20 +01:00
|
|
|
/* eslint-disable no-console */
|
2020-07-17 16:34:10 +02:00
|
|
|
return [Promise.resolve(console.info(`Found entry from service ${serviceName}, Job: ${jobKey}:`, newListings))];
|
2020-02-26 09:05:20 +01:00
|
|
|
/* eslint-enable no-console */
|
2018-01-20 20:23:27 +01:00
|
|
|
};
|
2021-01-21 16:09:23 +01:00
|
|
|
|
|
|
|
|
exports.config = {
|
|
|
|
|
id: __filename.slice(__dirname.length + 1, -3),
|
|
|
|
|
name: 'Console',
|
|
|
|
|
description: 'This adapter sends new listings to the console. It is mostly useful for debugging.',
|
|
|
|
|
config: {},
|
|
|
|
|
readme: markdown2Html('lib/notification/adapter/console.md'),
|
|
|
|
|
};
|