From 486d3090c41fe1a2a051296bdac0fe9043357a51 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 2 Sep 2024 17:04:53 +0100 Subject: [PATCH] Add more things to the price dictionary --- static/script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/script.js b/static/script.js index ebfd7ae..46220ea 100755 --- a/static/script.js +++ b/static/script.js @@ -1,10 +1,10 @@ // This code is licensed under GNU GPLv3. const BASE_URL = "/api/appinfo"; var TS4_APP_ID = 1222670; -const APPID_REGEX = /#(\d{5,10})/ +const APPID_REGEX = /#((http(s)?:\/\/store\.steampowered\.com\/app\/)?(?\d{4,10})(.*))/ if(APPID_REGEX.test(window.location.hash)===true) { let matches = APPID_REGEX.exec(window.location.hash); - TS4_APP_ID = parseInt(matches[1]) + TS4_APP_ID = parseInt(matches.groups.appID); console.debug("Set app ID to " + TS4_APP_ID); } else { console.debug("No custom ID set or does not match regex."); @@ -15,8 +15,9 @@ const NAME_ELEMENT = document.getElementById("name"); /* * These prices are gathered from a range of sources, such as Tesco, Amazon, and CeX. * Some prices may no longer be correct. They do not include discounts. + * Prices are often not updated after they're added. Prices are in GBP. * - * Last updated: 10/12/2023 + * Last updated: 2024-09-02 */ const PRICES = { "Freddo (18g)": 0.25, @@ -29,9 +30,10 @@ const PRICES = { "Dell Optiplex 7040 USFF (6th generation Intel i5)": 25.00, "Tenda AC10 V3.0 AC1200 Dual Band Gigabit Wireless Cable Router": 27.99, "Seagate SkyHawk 4TB 3.5\" 7200RPM HDD": 30.00, + "Dell Optiplex 7040 SFF (6th generation Intel i5)": 36.00, "Dell Optiplex 3020 USFF (4th generation Intel i5)": 39.99, "TP-Link AX1800 WiFi 6 Router": 39.99, - "KIOXIA EXERIA NVMe M.2 SSD (1TB)": 43.20, + "KIOXIA EXERIA NVMe M.2 SSD (1TB)": 43.20, // I *wish* they still cost this much - ~nex 2024-09-02 "Seagate BarraCuda,Internal Hard Drive 2.5 Inch (1TB)": 49.99, "Kingston NV2 NVMe PCIe 4.0 Internal SSD (1TB)": 59.99, "NVIDIA GeForce GTX 1650": 117.96, @@ -39,6 +41,8 @@ const PRICES = { "TP-Link AX5400 WiFi 6 Router": 159.99, "Intel Core i5-13400F": 191.99, "Apple Watch SE (1st generation)": 219.00, + "Windows 11 Pro license": 219.99, // https://www.microsoft.com/en-gb/d/windows-11-pro/dg7gmgf0d8h4/000P + "HP ProBook 455 G8": 289.79, // second hand from eBay, bought 2024-07-06 "iPhone SE (3rd generation/5G/2022)": 499.00, "My custom PC (https://uk.pcpartpicker.com/user/nexy7574/saved/#view=cKYV4D)": 800.00, "NVIDIA GeForce RTX 4090": 1519.00,