From 27b36802b876805ae30c322ecbadf7286d2239fb Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Mon, 10 May 2021 13:23:25 -0600 Subject: final cleanup before first release --- .../java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java') diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java index f0d9db7..284b735 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java @@ -14,7 +14,7 @@ public class RoomData { String friendCode; ArrayList players = new ArrayList<>(); - public RoomData (ArrayList players, String playerLink, String friendCode) { + public RoomData (ArrayList players, String friendCode) { this.friendCode = friendCode; getPlayerLink(); Document doc = null; @@ -91,10 +91,8 @@ public class RoomData { public void getPlayerLink() { try { - Document doc = null; - - doc = Jsoup.connect("https://wiimmfi.de/stats/mkw") - .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (UNDER DEVELOPMENT)") + Document doc = Jsoup.connect("https://wiimmfi.de/stats/mkw") + .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (Developer testing)") .get(); Element table = doc.select("table").get(0); Elements rows = table.select("tr"); @@ -102,13 +100,11 @@ public class RoomData { for (int i = 0; i < rows.size(); i++) { Element row = rows.get(i); Elements colPlayers = row.select("td"); - Elements colHeader = row.select("th"); if (colPlayers.size() > 0) { String data = colPlayers.get(0).select("a").toString(); -// System.out.println(data); if (data.contains(friendCode)) { System.out.println("Found friend code"); playerLink = data.split("\"")[3]; @@ -130,7 +126,7 @@ public class RoomData { public RoomData refresh() { players.clear(); roomHeader = ""; - return new RoomData(players, playerLink, friendCode); + return new RoomData(players, friendCode); } } -- cgit v1.2.3