mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37948be0d3 | ||
|
|
cc7bbb77c4 | ||
|
|
96da0b7892 | ||
|
|
72993312c7 |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Christian Kellner
|
Copyright (c) 2023 Christian Kellner
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
import { markdown2Html } from '../../services/markdown.js';
|
|
||||||
import Database from 'better-sqlite3';
|
|
||||||
export const send = ({ serviceName, newListings, jobKey }) => {
|
|
||||||
const db = new Database('db/listings.db');
|
|
||||||
const fields = ['serviceName', 'jobKey', 'id', 'size', 'rooms', 'price', 'address', 'title', 'link', 'description'];
|
|
||||||
db.prepare(`CREATE TABLE IF NOT EXISTS listing (${fields.join(' TEXT, ')} TEXT);`).run();
|
|
||||||
const insert = db.prepare(`INSERT INTO listing (${fields.join(', ')}) VALUES (@${fields.join(', @')})`);
|
|
||||||
newListings.map((listing) => {
|
|
||||||
let insertListing = {};
|
|
||||||
fields.map((field) => {
|
|
||||||
insertListing[field] = listing[field];
|
|
||||||
});
|
|
||||||
insertListing.serviceName = serviceName;
|
|
||||||
insertListing.jobKey = jobKey;
|
|
||||||
insert.run(insertListing);
|
|
||||||
});
|
|
||||||
return Promise.resolve();
|
|
||||||
};
|
|
||||||
export const config = {
|
|
||||||
id: 'sqlite',
|
|
||||||
name: 'Sqlite',
|
|
||||||
description: 'This adapter stores listings in a local sqlite3 database.',
|
|
||||||
config: {},
|
|
||||||
readme: markdown2Html('lib/notification/adapter/sqlite.md'),
|
|
||||||
};
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
### Sqlite Adapter
|
|
||||||
|
|
||||||
This adapter stores search results in an sqlite database in db/listings.db
|
|
||||||
@@ -19,7 +19,7 @@ const config = {
|
|||||||
sortByDateParam: null,
|
sortByDateParam: null,
|
||||||
crawlFields: {
|
crawlFields: {
|
||||||
id: '.aditem@data-adid | int',
|
id: '.aditem@data-adid | int',
|
||||||
price: '.aditem-main--middle--price | removeNewline | trim',
|
price: '.aditem-main--middle--price-shipping--price | removeNewline | trim',
|
||||||
size: '.aditem-main .text-module-end span:nth-child(2) | removeNewline | trim',
|
size: '.aditem-main .text-module-end span:nth-child(2) | removeNewline | trim',
|
||||||
title: '.aditem-main .text-module-begin a | removeNewline | trim',
|
title: '.aditem-main .text-module-begin a | removeNewline | trim',
|
||||||
link: '.aditem-main .text-module-begin a@href | removeNewline | trim',
|
link: '.aditem-main .text-module-begin a@href | removeNewline | trim',
|
||||||
|
|||||||
19
package.json
19
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "fredy",
|
"name": "fredy",
|
||||||
"version": "7.4.0",
|
"version": "7.4.1",
|
||||||
"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 index.js",
|
"start": "node index.js",
|
||||||
@@ -55,12 +55,11 @@
|
|||||||
"Firefox ESR"
|
"Firefox ESR"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@douyinfe/semi-ui": "2.44.0",
|
"@douyinfe/semi-ui": "2.45.2",
|
||||||
"@rematch/core": "2.2.0",
|
"@rematch/core": "2.2.0",
|
||||||
"@rematch/loading": "2.1.2",
|
"@rematch/loading": "2.1.2",
|
||||||
"@sendgrid/mail": "7.7.0",
|
"@sendgrid/mail": "7.7.0",
|
||||||
"@vitejs/plugin-react": "4.1.0",
|
"@vitejs/plugin-react": "4.1.0",
|
||||||
"better-sqlite3": "8.6.0",
|
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.2",
|
||||||
"cookie-session": "2.0.0",
|
"cookie-session": "2.0.0",
|
||||||
"handlebars": "4.7.8",
|
"handlebars": "4.7.8",
|
||||||
@@ -75,7 +74,7 @@
|
|||||||
"query-string": "8.1.0",
|
"query-string": "8.1.0",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"react-redux": "8.1.2",
|
"react-redux": "8.1.3",
|
||||||
"react-router": "5.2.1",
|
"react-router": "5.2.1",
|
||||||
"react-router-dom": "5.3.0",
|
"react-router-dom": "5.3.0",
|
||||||
"redux": "4.2.1",
|
"redux": "4.2.1",
|
||||||
@@ -84,19 +83,19 @@
|
|||||||
"serve-static": "1.15.0",
|
"serve-static": "1.15.0",
|
||||||
"slack": "11.0.2",
|
"slack": "11.0.2",
|
||||||
"string-similarity": "^4.0.4",
|
"string-similarity": "^4.0.4",
|
||||||
"vite": "4.4.9",
|
"vite": "4.5.0",
|
||||||
"x-ray": "2.3.4"
|
"x-ray": "2.3.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.23.0",
|
"@babel/core": "7.23.2",
|
||||||
"@babel/eslint-parser": "7.22.15",
|
"@babel/eslint-parser": "7.22.15",
|
||||||
"@babel/preset-env": "7.22.20",
|
"@babel/preset-env": "7.23.2",
|
||||||
"@babel/preset-react": "7.22.15",
|
"@babel/preset-react": "7.22.15",
|
||||||
"chai": "4.3.9",
|
"chai": "4.3.10",
|
||||||
"eslint": "8.50.0",
|
"eslint": "8.52.0",
|
||||||
"eslint-config-prettier": "8.8.0",
|
"eslint-config-prettier": "8.8.0",
|
||||||
"eslint-plugin-react": "7.33.2",
|
"eslint-plugin-react": "7.33.2",
|
||||||
"esmock": "2.5.1",
|
"esmock": "2.5.8",
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"husky": "4.3.8",
|
"husky": "4.3.8",
|
||||||
"less": "4.2.0",
|
"less": "4.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user