From af935a1ea24b5194571ca68e9231180be4e5fbcb Mon Sep 17 00:00:00 2001 From: LiuEnder Date: Fri, 13 Mar 2026 17:59:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E6=8E=A8=E9=80=81=E6=95=B0=E7=BB=84=EF=BC=9B=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B5=8B=E8=AF=95=E7=94=A8=E9=A1=B5=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GoldPrice.js | 2 +- testpage.html | 471 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 472 insertions(+), 1 deletion(-) create mode 100644 testpage.html diff --git a/GoldPrice.js b/GoldPrice.js index f397955..a5792b6 100644 --- a/GoldPrice.js +++ b/GoldPrice.js @@ -22,7 +22,7 @@ const SERVER_CHAN_KEY_RAW = SERVER_CHAN_KEY_DIRECT || process.env.PUSH_KEYT || ' const SERVER_CHAN_KEYS = SERVER_CHAN_KEY_RAW.split(';').map(k => k.trim()).filter(k => k.length > 0); // 可自定义的特殊提醒价格数组:[价格1,价格2,价格3,价格4,价格5,价格6,价格7] -const SPECIAL_PRICE_TARGETS = []; +const SPECIAL_PRICE_TARGETS = [1000,1010,1020,1030,1040,1050,1060,1070,1080,1090,1100,1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220,1230,1240,1250,1260,1270,1280,1290,1300,1310,1320,1330,1340,1350,1360,1370,1380,1390,1400,1410,1420,1430,1440,1450,1460,1470,1480,1490,1500]; // 可配置项:变化量阈值(元/克)、变化计算窗口(分钟)、采样间隔(分钟)、价格精度(小数位数) const CONFIG = { diff --git a/testpage.html b/testpage.html new file mode 100644 index 0000000..36e5cd6 --- /dev/null +++ b/testpage.html @@ -0,0 +1,471 @@ + + + + + + + + 黄金价格测试页面 + + + +
+
+

黄金价格测试页面

+

用于测试黄金价格监控脚本的模拟页面

+
+ +
+
+
当前黄金价格 (元/克)
+
1150.22
+
价格未变化
+
+ +
+
+ + +
+ +
+ + + + +
+
+ +
+

价格历史记录

+
    +
  • + 刚刚 + 1150.22 元/克 +
  • +
  • + 1分钟前 + 1149.53 元/克 +
  • +
+
+ +
+

使用说明

+

1. 此页面模拟了黄金价格页面,价格元素的选择器为 #activeprice_080020000521,与您的监控脚本使用的选择器一致。

+

2. 通过上方输入框和按钮可以修改页面显示的黄金价格。

+

3. 您可以在本地运行此页面,然后将监控脚本中的 TARGET_URL 修改为此页面的地址(如 http://localhost:8000/test.html)进行测试。

+

4. 您可以使用 Python 的简单HTTP服务器运行此页面:python3 -m http.server 8000

+
+
+
+ + + + \ No newline at end of file