2018-01-20 20:23:27 +01:00
|
|
|
/**
|
|
|
|
|
* simply prints out the found data to the console
|
|
|
|
|
* @param serviceName e.g immoscout
|
2018-02-06 13:57:32 +01:00
|
|
|
* @param newListings an array with newly found listings
|
2020-02-26 09:05:20 +01:00
|
|
|
* @param notificationConfig config of this notification adapter
|
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
|
|
|
*/
|
2020-07-17 16:34:10 +02:00
|
|
|
exports.send = (serviceName, newListings, notificationConfig, jobKey) => {
|
2020-02-26 09:05:20 +01:00
|
|
|
const { enabled } = notificationConfig.console;
|
|
|
|
|
if (!enabled) {
|
|
|
|
|
return [Promise.resolve()];
|
|
|
|
|
}
|
|
|
|
|
/* 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
|
|
|
};
|