diff --git a/index.js b/index.js index ada4765..b6d03b6 100644 --- a/index.js +++ b/index.js @@ -24,14 +24,14 @@ var startTime = Date.now() var prevGame = "" function update() { - fetch(`https://steamcommunity.com/miniprofile/${steamID}?origin=https%3A%2F%2Fsteamcommunity.com`) + fetch(`https://steamcommunity.com/miniprofile/${steamID}`) .then((data) => { return data.text() }) .then((html) => { var json = { "name": "nothing", - "presence": "" + "presence": "Offline" } if (html.includes("game_name")) { @@ -42,6 +42,9 @@ function update() { if (html.includes("presence")) { var blah = html.substring(html.indexOf('presence">') + 10, html.length) json["presence"] = blah.substring(0, blah.indexOf("")) + } else if (html.includes("friend_status_online") && json.name != "nothing") { + var blah = html.substring(html.indexOf('status_online">') + 15, html.length) + json["presence"] = blah.substring(0, blah.indexOf("")) } if (prevGame != json.name) {