From d44e1490261765f73ee6a40aa735b4efb3e7e80a Mon Sep 17 00:00:00 2001 From: Jorge Bolois Date: Sat, 15 Apr 2023 13:09:48 +0200 Subject: [PATCH] Changing data endpoint. --- .env | 2 +- bundler.js | 15 +++++++++------ src/Locations.js | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.env b/.env index cd91ce2..1173fdf 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ NAME=Idealista Enhancer DESCRIPTION=Just some information for idealista.com -VERSION=0.2.2 +VERSION=0.2.21 AUTHOR=Midefos NAMESPACE=https://git.midefos.com/midefos MATCH=https://www.idealista.com/* \ No newline at end of file diff --git a/bundler.js b/bundler.js index 87d5aff..61e37cf 100644 --- a/bundler.js +++ b/bundler.js @@ -1,14 +1,17 @@ import fs from 'fs'; import browserify from 'browserify'; +import dotenv from 'dotenv'; import banner from 'browserify-banner'; +dotenv.config(); + const STATIC_BANNER = "// ==UserScript==\n" + - "// @name Idealista Enhancer\n" + - "// @description Just some information for idealista.com\n" + - "// @version 0.2.1\n" + - "// @author Midefos\n" + - "// @namespace https://github.com/Midefos\n" + - "// @match https://www.idealista.com/*\n" + + `// @name ${process.env['NAME']}\n` + + `// @description ${process.env['DESCRIPTION']}\n` + + `// @version ${process.env['VERSION']}\n` + + `// @author ${process.env['AUTHOR']}\n` + + `// @namespace ${process.env['NAMESPACE']}\n` + + `// @match ${process.env['MATCH']}\n` + "// @license MIT\n" + "// ==/UserScript==\n\n"; diff --git a/src/Locations.js b/src/Locations.js index 38a6a97..f09b3b7 100644 --- a/src/Locations.js +++ b/src/Locations.js @@ -10,7 +10,7 @@ export default class Locations { return storageLocation; } - const response = await fetch(`https://ih-data.midefos.com/api/town/${name}`); + const response = await fetch(`https://main.midefos.com/api/town/${name}`); Log.debug(`Requested location '${name}'`); const data = await response.json();