fixing neubaukompass && updating dependencies

This commit is contained in:
Christian Kellner
2019-10-24 21:25:19 +02:00
parent 8e225f761c
commit 9106144d9c
8 changed files with 341 additions and 529 deletions

View File

@@ -9,7 +9,7 @@ function normalize(o) {
const address = o.address.split(' • ')[1];
const title = o.title || 'No title available';
return Object.assign(o, {id, address, price, size, title});
return Object.assign(o, { id, address, price, size, title });
}
function applyBlacklist(o) {

View File

@@ -5,7 +5,7 @@ const utils = require('../utils');
function normalize(o) {
const size = o.size || '--- m²';
return Object.assign(o, {size});
return Object.assign(o, { size });
}
function applyBlacklist(o) {

View File

@@ -17,9 +17,9 @@ const neubauKompass = {
crawlContainer: '.row article',
crawlFields: {
id: '@id',
title: 'a@title | removeNewline | trim',
link: 'a@href',
address: 'div.p-2 > p:nth-child(3) | removeNewline | trim'
title: 'div.p-2 > a@title | removeNewline | trim',
link: 'div.p-2 > a@href',
address: 'div.p-2 > p | removeNewline | trim'
},
paginate: '.numbered-pager__bottom .numbered-pager--info li:nth-child(2) a@href',
normalize: normalize,

View File

@@ -8,7 +8,7 @@ if (config.enableStats) {
const http = require('http');
http
.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'application/json'});
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(
JSON.stringify({
config,
@@ -33,4 +33,3 @@ exports.setLastScrape = (serviceName, numberOfNewListsings) => {
stats.foundScrapes[dt][serviceName] = numberOfNewListsings;
}
};

View File

@@ -1,11 +1,11 @@
{
"name": "Fredy",
"version": "1.2.0",
"version": "1.2.1",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": {
"start": "node index.js",
"format": "prettier --write lib/**/*.js test/**/*.js *.js --single-quote --print-width 120",
"test": "mocha --timeout 8000"
"test": "mocha --timeout 9000"
},
"main": "index.js",
"author": "Christian Kellner",
@@ -31,12 +31,12 @@
"chai": "4.2.0",
"lowdb": "1.0.0",
"request-x-ray": "0.1.4",
"slack": "10.1.1",
"slack": "11.0.2",
"tg-yarl": "1.3.0",
"x-ray": "2.3.3"
"x-ray": "2.3.4"
},
"devDependencies": {
"mocha": "6.1.4",
"mocha": "6.2.2",
"prettier": "1.18.2",
"proxyquire": "1.8.0"
}

View File

@@ -40,7 +40,6 @@ describe('#kleinanzeigen testsuite()', () => {
expect(notify.id).to.equal(
kleinanzeigenDbContent.kleinanzeigen[idx]
);
expect(notify.size).that.does.include('m²');
expect(notify.title).to.be.not.empty;
expect(notify.link).that.does.include('https://www.ebay-kleinanzeigen.de');
expect(notify.address).to.be.not.empty;

656
yarn.lock

File diff suppressed because it is too large Load Diff