From e700953ebbe12d1af8d786eb9250e39ad5fc3ef5 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Fri, 21 May 2021 07:36:58 -0600 Subject: fixed useragent issue in RoomData --- app/build.gradle | 4 ++-- .../main/java/me/brysonsteck/wiimmfiwatcher/wiimmfi/RoomData.java | 8 ++++++-- app/src/main/res/values/strings.xml | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6d97081..5e43102 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "me.brysonsteck.wiimmfiwatcher" minSdkVersion 19 targetSdkVersion 30 - versionCode 2 - versionName "1.1" + versionCode 3 + versionName "1.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } 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 players = new ArrayList<>(); + String userAgent = "Wiimmfi Watcher for Android (https://github.com/brysonsteck/wiimmfi-watcher) Version " + BuildConfig.VERSION_NAME; public RoomData (ArrayList 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"); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bb66ede..3c7c9b2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,8 +1,8 @@ Wiimmfi - All of the code in this project is open source on my GitHub repository here. You are free to use this code and expand upon it under the GNU General Public License. - Speaking of bugs, did you find a bug? First, make sure that the issue you found is not listed on my todo list. It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository here. If you don\'t know how to use GitHub, you can fill out this Google Form instead. - © Copyright 2021 Bryson Steck\n\nWiimmfi Watcher is available under the GNU General Public License Version 3. You can view the license here.\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify + All of the code in this project is open source on my GitHub repository here. You are free to use this code and expand upon it under the GNU General Public License (Version 3). + Speaking of bugs, did you find a bug? Do you want to provide feedback on the app? I\'d love to hear it! First, make sure that the issue you found is not listed on my todo list. It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository here. If you don\'t know how to use GitHub, you can fill out this Google Form instead. + © Copyright 2021 Bryson Steck\n\nWiimmfi Watcher is available under the GNU General Public License Version 3. You can view the license here.\n\nWiimmfi Watcher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nWiimmfi Watcher is distributed in the hope that it will be useful, @@ -10,5 +10,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Wiimmfi Watcher. If not, see <https://www.gnu.org/licenses/>. - If you would like to get ahold of me for any reason unrelated to bug reports or this app in general, you can contact me through email at steck.bryson@gmail.com or on Discord at bryzinga#9971. + If you would like to get a hold of me for any reason unrelated to bug reports or this app in general, you can contact me through email at steck.bryson@gmail.com or on Discord at bryzinga#9971. \ No newline at end of file -- cgit v1.2.3