mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
fixing kalaydo provider
This commit is contained in:
@@ -8,8 +8,8 @@ function normalize(o) {
|
|||||||
.split('/')
|
.split('/')
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.reverse()[0];
|
.reverse()[0];
|
||||||
const price = o.price.replace('Preis: ', '');
|
const price = o.price == null ? 'unknown' : o.price.trim().replace('Preis', '');
|
||||||
let size = o.size.replace('Wohnfläche: ', '').replace('ca. ', '');
|
let size = o.size == null ? 'unknown' : o.size.replace('Wohnfläche: ', '').replace('ca. ', '');
|
||||||
size += ' / ' + o.rooms;
|
size += ' / ' + o.rooms;
|
||||||
const address = '---';
|
const address = '---';
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ const config = {
|
|||||||
crawlContainer: '#resultList .resultitem-content-container',
|
crawlContainer: '#resultList .resultitem-content-container',
|
||||||
crawlFields: {
|
crawlFields: {
|
||||||
id: '.resultitem-content-container a@href',
|
id: '.resultitem-content-container a@href',
|
||||||
price: '.clear-row .rent | removeNewline | trim',
|
price: '.description .rent | removeNewline | trim',
|
||||||
title: '.resultitem-content-container a@title',
|
title: '.resultitem-content-container a@title',
|
||||||
link: '.resultitem-content-container a@href',
|
link: '.resultitem-content-container a@href',
|
||||||
rooms: '.resultitem-content-container .no-of-rooms | removeNewline | trim',
|
rooms: '.resultitem-content-container .no-of-rooms | removeNewline | trim',
|
||||||
@@ -54,4 +54,3 @@ exports.init = (sourceConfig, blacklist, blacklistedDistricts) => {
|
|||||||
exports.id = () => 'kalaydo';
|
exports.id = () => 'kalaydo';
|
||||||
|
|
||||||
exports.config = config;
|
exports.config = config;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ describe('#kalaydo testsuite()', () => {
|
|||||||
'./notification/notify': mockNotification
|
'./notification/notify': mockNotification
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should test kalaydo provider', async () => {
|
it.only('should test kalaydo provider', async () => {
|
||||||
return await new Promise(resolve => {
|
return await new Promise(resolve => {
|
||||||
const fredy = new Fredy(provider.config, null, provider.id(), 'test1');
|
const fredy = new Fredy(provider.config, null, provider.id(), 'test1');
|
||||||
fredy.execute().then(() => {
|
fredy.execute().then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user