aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-05-21 07:36:58 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-05-21 07:36:58 -0600
commite700953ebbe12d1af8d786eb9250e39ad5fc3ef5 (patch)
treea1118cf8cbfe9126d9754baf41b4714151df977c /app/src/main/java/me
parent235d33e9f4d8c5ee2584fdd4ee8360f098621071 (diff)
downloadwiimmfi-watcher-e700953ebbe12d1af8d786eb9250e39ad5fc3ef5.tar
wiimmfi-watcher-e700953ebbe12d1af8d786eb9250e39ad5fc3ef5.tar.gz
wiimmfi-watcher-e700953ebbe12d1af8d786eb9250e39ad5fc3ef5.tar.bz2
fixed useragent issue in RoomData
Diffstat (limited to 'app/src/main/java/me')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java8
1 files changed, 6 insertions, 2 deletions
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 64afedc..47faf4b 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java
@@ -8,11 +8,14 @@ import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.ArrayList;
+import me.brysonsteck.wiimmfiwatcher.BuildConfig;
+
public class RoomData {
String roomHeader;
String playerLink;
String friendCode;
ArrayList<Player> players = new ArrayList<>();
+ String userAgent = "Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) Version " + BuildConfig.VERSION_NAME;
public RoomData (ArrayList<Player> players, String friendCode) {
this.friendCode = friendCode;
@@ -24,8 +27,9 @@ public class RoomData {
} else {
try {
+ System.out.println(userAgent);
doc = Jsoup.connect("https://wiimmfi.de/" + this.playerLink)
- .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) (UNDER DEVELOPMENT)")
+ .userAgent(userAgent)
.get();
} catch (IOException e) {
e.printStackTrace();
@@ -92,7 +96,7 @@ public class RoomData {
public void getPlayerLink() {
try {
Document doc = Jsoup.connect("https://wiimmfi.de/stats/mkw")
- .userAgent("Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher)")
+ .userAgent(userAgent)
.get();
Element table = doc.select("table").get(0);
Elements rows = table.select("tr");