Add in current game playing display back to Twitch module.

master 2.0
sigonasr2 5 years ago
parent 38c3a9bdfd
commit 71e9a6872c
  1. BIN
      sigIRCv2.jar
  2. 9
      src/sig/modules/TwitchModule.java

Binary file not shown.

@ -220,6 +220,15 @@ public class TwitchModule extends Module{
.ofPattern("uuuu-MM-dd'T'HH:mm:ssz"); .ofPattern("uuuu-MM-dd'T'HH:mm:ssz");
uptime = ZonedDateTime.parse(stream.getString("started_at"),DATE_TIME_FORMATTER); uptime = ZonedDateTime.parse(stream.getString("started_at"),DATE_TIME_FORMATTER);
viewers_numb.updateValue(stream.getInt("viewer_count")); viewers_numb.updateValue(stream.getInt("viewer_count"));
//System.out.println(stream.getString("game_id"));
if (stream.getString("game_id").length()>0 && !stream.getString("game_id").equalsIgnoreCase("null")) {
int gameID = Integer.parseInt(stream.getString("game_id"));
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/games?id="+gameID, "game_info",true);
JSONObject gameData = FileUtils.readJsonFromFile("game_info");
currentlyPlaying = gameData.getJSONArray("data").getJSONObject(0).getString("name");
} else {
currentlyPlaying = "";
}
} }
FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users/follows?to_id="+sigIRC.channel_id, "temp_followers",true); FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users/follows?to_id="+sigIRC.channel_id, "temp_followers",true);
JSONObject FollowerData = FileUtils.readJsonFromFile("temp_followers"); JSONObject FollowerData = FileUtils.readJsonFromFile("temp_followers");

Loading…
Cancel
Save