Compare commits

...

4 Commits

Author SHA1 Message Date
Christian Kellner
25cc7fb650 next release version 2025-07-22 20:01:01 +02:00
Alexander Roidl
78df4b21a6 Remove leading commas from listings in Telegram messages (#142) 2025-07-22 19:58:16 +02:00
weakmap@gmail.com
d89b078237 lol 2025-07-19 22:41:30 +02:00
weakmap@gmail.com
395199a4a2 fixing duplicate provider removal / ugrade dependencies 2025-07-19 20:10:19 +02:00
10 changed files with 454 additions and 351 deletions

View File

@@ -22,16 +22,18 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) =
const { token, chatId } = notificationConfig.find((adapter) => adapter.id === config.id).fields; const { token, chatId } = notificationConfig.find((adapter) => adapter.id === config.id).fields;
const job = getJob(jobKey); const job = getJob(jobKey);
const jobName = job == null ? jobKey : job.name; const jobName = job == null ? jobKey : job.name;
//we have to split messages into chunk, because otherwise messages are going to become too big and will fail // we have to split messages into chunks, because otherwise messages are going to become too big and will fail
const chunks = arrayChunks(newListings, MAX_ENTITIES_PER_CHUNK); const chunks = arrayChunks(newListings, MAX_ENTITIES_PER_CHUNK);
const promises = chunks.map((chunk) => { const promises = chunks.map((chunk) => {
let message = `<i>${jobName}</i> (${serviceName}) found <b>${newListings.length}</b> new listings:\n\n`; const messageParagraphs = [];
message += chunk.map(
messageParagraphs.push(`<i>${jobName}</i> (${serviceName}) found <b>${newListings.length}</b> new listings:`);
messageParagraphs.push(...chunk.map(
(o) => (o) =>
`<a href='${o.link}'><b>${shorten(o.title.replace(/\*/g, ''), 45).trim()}</b></a>\n` + `<a href='${o.link}'><b>${shorten(o.title.replace(/\*/g, ''), 45).trim()}</b></a>\n` +
[o.address, o.price, o.size].join(' | ') + [o.address, o.price, o.size].join(' | ')
'\n\n', ));
);
/** /**
* This is to not break the rate limit. It is to only send 1 message per second * This is to not break the rate limit. It is to only send 1 message per second
*/ */
@@ -41,7 +43,7 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) =
method: 'post', method: 'post',
body: JSON.stringify({ body: JSON.stringify({
chat_id: chatId, chat_id: chatId,
text: message, text: messageParagraphs.join('\n\n'),
parse_mode: 'HTML', parse_mode: 'HTML',
disable_web_page_preview: true, disable_web_page_preview: true,
}), }),

View File

@@ -1,6 +1,6 @@
{ {
"name": "fredy", "name": "fredy",
"version": "11.2.4", "version": "11.2.6",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].", "description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": { "scripts": {
"start": "node prod.js", "start": "node prod.js",
@@ -50,17 +50,17 @@
"Firefox ESR" "Firefox ESR"
], ],
"dependencies": { "dependencies": {
"@douyinfe/semi-ui": "2.80.0", "@douyinfe/semi-ui": "2.83.0",
"@rematch/core": "2.2.0", "@rematch/core": "2.2.0",
"@rematch/loading": "2.1.2", "@rematch/loading": "2.1.2",
"@sendgrid/mail": "8.1.5", "@sendgrid/mail": "8.1.5",
"@vitejs/plugin-react": "4.5.2", "@vitejs/plugin-react": "4.7.0",
"better-sqlite3": "^11.10.0", "better-sqlite3": "^11.10.0",
"body-parser": "2.2.0", "body-parser": "2.2.0",
"cheerio": "^1.1.0", "cheerio": "^1.1.0",
"cookie-session": "2.1.0", "cookie-session": "2.1.1",
"handlebars": "4.7.8", "handlebars": "4.7.8",
"highcharts": "12.2.0", "highcharts": "12.3.0",
"highcharts-react-official": "3.2.2", "highcharts-react-official": "3.2.2",
"lodash": "4.17.21", "lodash": "4.17.21",
"lowdb": "6.0.1", "lowdb": "6.0.1",
@@ -70,10 +70,10 @@
"node-fetch": "3.3.2", "node-fetch": "3.3.2",
"node-mailjet": "6.0.8", "node-mailjet": "6.0.8",
"package-up": "^5.0.0", "package-up": "^5.0.0",
"puppeteer": "^24.10.1", "puppeteer": "^24.14.0",
"puppeteer-extra": "^3.3.6", "puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2", "puppeteer-extra-plugin-stealth": "^2.11.2",
"query-string": "9.2.0", "query-string": "9.2.2",
"react": "18.3.1", "react": "18.3.1",
"react-dom": "18.3.1", "react-dom": "18.3.1",
"react-redux": "9.2.0", "react-redux": "9.2.0",
@@ -85,24 +85,24 @@
"serve-static": "2.2.0", "serve-static": "2.2.0",
"slack": "11.0.2", "slack": "11.0.2",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"vite": "6.3.5" "vite": "7.0.5"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.27.3", "@babel/core": "7.27.3",
"@babel/eslint-parser": "7.27.5", "@babel/eslint-parser": "7.27.5",
"@babel/preset-env": "7.27.2", "@babel/preset-env": "7.27.2",
"@babel/preset-react": "7.27.1", "@babel/preset-react": "7.27.1",
"chai": "5.2.0", "chai": "5.2.1",
"eslint": "8.56.0", "eslint": "8.56.0",
"eslint-config-prettier": "8.8.0", "eslint-config-prettier": "8.8.0",
"eslint-plugin-react": "7.37.5", "eslint-plugin-react": "7.37.5",
"esmock": "2.7.0", "esmock": "2.7.1",
"history": "5.3.0", "history": "5.3.0",
"husky": "9.1.7", "husky": "9.1.7",
"less": "4.3.0", "less": "4.4.0",
"lint-staged": "15.5.2", "lint-staged": "15.5.2",
"mocha": "10.8.2", "mocha": "10.8.2",
"prettier": "3.5.3", "prettier": "3.6.2",
"redux-logger": "3.0.6" "redux-logger": "3.0.6"
} }
} }

View File

@@ -40,4 +40,8 @@ a:active {
color: #54a9ff; color: #54a9ff;
background-color: transparent; background-color: transparent;
text-decoration: underline; text-decoration: underline;
} }
.semi-icon {
vertical-align: middle;
}

View File

@@ -30,7 +30,7 @@ export default function ProviderTable({ providerData = [], onRemove } = {}) {
render: (_, record) => { render: (_, record) => {
return ( return (
<div style={{ float: 'right' }}> <div style={{ float: 'right' }}>
<Button type="danger" icon={<IconDelete />} onClick={() => onRemove(record.id)} /> <Button type="danger" icon={<IconDelete />} onClick={() => onRemove(record.url)} />
</div> </div>
); );
}, },

View File

@@ -4,6 +4,7 @@ import Logo from '../logo/Logo.jsx';
import {xhrPost} from '../../services/xhr.js'; import {xhrPost} from '../../services/xhr.js';
import './TrackingModal.less'; import './TrackingModal.less';
import inDevelopment from '../../services/developmentMode.js';
const saveResponse = async (analyticsEnabled) => { const saveResponse = async (analyticsEnabled) => {
await xhrPost('/api/admin/generalSettings', { await xhrPost('/api/admin/generalSettings', {
@@ -12,6 +13,9 @@ const saveResponse = async (analyticsEnabled) => {
}; };
export default function TrackingModal() { export default function TrackingModal() {
if(inDevelopment()){
return null;
}
return <Modal return <Modal
visible={true} visible={true}

View File

@@ -0,0 +1,4 @@
export default function isDevelopmentMode(){
const inDevMode= import.meta.env.MODE;
return inDevMode != null && inDevMode === 'development';
}

View File

@@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import {format} from '../../services/time/timeService'; import {format} from '../../services/time/timeService';
import {Banner, Descriptions} from '@douyinfe/semi-ui'; import {Descriptions} from '@douyinfe/semi-ui';
export default function ProcessingTimes({processingTimes = {}}) { export default function ProcessingTimes({processingTimes = {}}) {
if (Object.keys(processingTimes).length === 0) { if (Object.keys(processingTimes).length === 0) {

View File

@@ -124,8 +124,8 @@ export default function JobMutator() {
<ProviderTable <ProviderTable
providerData={providerData} providerData={providerData}
onRemove={(providerId) => { onRemove={(providerUrl) => {
setProviderData(providerData.filter((provider) => provider.id !== providerId)); setProviderData(providerData.filter((provider) => provider.url !== providerUrl));
}} }}
/> />
</SegmentPart> </SegmentPart>

View File

@@ -101,7 +101,7 @@ export default function ProviderMutator({ onVisibilityChanged, visible = false,
description={ description={
<div> <div>
<p> <p>
Currently, our Immoscout implementation does not drawing shapes on a map. Use a radius instead. Currently, our Immoscout implementation does not support drawing shapes on a map. Use a radius instead.
</p> </p>
</div> </div>
} }

741
yarn.lock

File diff suppressed because it is too large Load Diff