![]() Posts: 67 Reputation: +28 Joined: 2014-08-19 |
Posted 2021-12-02 20:59
|
![]() |
Hello everyone, I wanted to propose if this game could be introduced, since I found a page that collected all the achievements made within the game, this game is an MMO that came out years ago, and closed, but they have reopened thanks to the community. I send links of my main character, I hope you can see if you can add to this wonderful page Thank you very much for your effort https://cityofbadgers.com/UserAccount |
|
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2021-12-04 20:57
|
![]() |
Hi, thanks for your suggestion! Unfortunately , it looks like you need to be logged in to see your badges. Thus, we would need your login details to collect the badge information - which we won't do. So, unfortunately, it looks like we won't be adding support for this site. However, if there is something I've overlooked, you can share it here and I'll have another look. But as of right now, I can only see the global badges, not individual's. :/ Thanks for the suggestion! ^^ |
|
![]() Posts: 67 Reputation: +28 Joined: 2014-08-19 |
Posted 2021-12-04 22:24
|
![]() |
Maybe trying the leaderboard tab, server: torchbearer toon name: Hivan, there you can click, and later on the drop-down you can click on the list of achievements, to see if you can see them Thanks for everything https://cityofbadgers.com/Leaderboard |
|
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2021-12-04 22:49
|
![]() |
Hi, thanks for the info! Alrighty, we can access others' badges, but... we must find a way to just get your badges. Right now, we would need to search for your name in the leaderboard, then click on your name and then click for each of the subcategories of badges. That's how I would do it manually, but of course, we need to automate this process. Unfortunately, I don't see how we could do all those steps with code. Furthermore, notice how if you go to Badges you can see in the address bar that it has: ?activeTab=categorie&badgeTypeID=6&pageNo=1&searchKeyword= That would allow us to search this page dynamically with code. But if you go to the leaderboards, and search for a name, we do not get that text in the address bar :( Also, when we press Hivon, do you notice how it loads? That means that we cannot just read from this page, and currently, we have not found a good way to access this information that only pops up after some time of loading... I will bring this up internally, maybe we can still figure something out, I just don't see it right now. :/ |
|
![]() Posts: 67 Reputation: +28 Joined: 2014-08-19 |
Posted 2021-12-04 22:54
|
![]() |
I understand, I will also look for some other page that can go better, if it exists XD | |
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2021-12-04 23:01
|
![]() |
Yeah, please do! ^_^ I just finished coding some Runescape Quests stuff. It's a lot of fun for me to do, and if adding support to the games you play makes you enjoy them even more, we are more than happy to try to add support for their achievements/badges/quests too! :) |
|
![]() Posts: 67 Reputation: +28 Joined: 2014-08-19 |
Posted 2021-12-05 11:12
|
![]() |
Hello, I have found another page, if you can do something with this one :) https://n15g.github.io/badger/character/jXq9IROqv |
|
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2021-12-05 17:40
|
![]() |
Nope, unfortunately not... :( If you go to the link you posted in "incognito mode" (so that you don't have browser cookies), you will see that there are no characters and there is like a disclaimer at the top stating: "All data saved in Badger is stored locally on your device. While this means you don't have to log in to anything to save character information, it does mean that data is not shared between devices, and if you delete your browser cache you will lose your character data." So this won't work either :( |
|
![]() Posts: 67 Reputation: +28 Joined: 2014-08-19 |
Posted 2021-12-05 22:19
|
![]() |
Ok, I'll keep investigating | |
![]() Posts: 7 Reputation: +7 Joined: 2021-07-25 |
Posted 2022-01-07 23:12
|
![]() |
I did a quick digging on the devtools of the browser to find the XHR (AJAX) requests. I found two relevant ones: https://cityofbadgers.com/Leaderboard/GridContent?archetypeID=&blockID=&globalName=&page=1&serverID=&toonName=him This searches for someone, and returns a table with the results. This can be tricky if there is no exact match, or if the table returns multiple rows (potentially over multiple pages). An exact match search would be a much more reliable API. I'd suggest asking the website maintainers to see if that would be possible, but I have no idea how to contact them. Anyway, for each row (< tr >) in the resulting table, it includes an id (data-id="…"). Remember this id, as it can be used in: https://cityofbadgers.com/Toon/Index?toonID=1042 Which, again, returns a table with the achievements for the user/player/character of that id. Not an ideal API at all, but it could work. Note: I've never played that game, I'm just reporting what I found on the website cited in this thread. |
|
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2022-01-08 03:07
|
![]() |
That's an amazing find! Thank you for that. I noticed that, what about instead of using the "name" and instead use the completely unique Global name like so: https://cityofbadgers.com/Leaderboard/GridContent?archetypeID=&blockID=&globalName=Hivan However, as seen here, is that we still get multiple characters. What we could do, is ask for both the account name and character name to track... unless we could merge all of the users characters. I was a bit confused about the id thing, but I realized there's some tag that includes their internal id. The major issue, for me, is that I cannot access the achievements? The link you provided (the one with badges, achievements etc.) does nothing when I try to expand Achievements, even though it has an onclick event calling on a function "return fnShowToonBadgeSegment(1042, 3);". I tried it in Opera GX, Egde and Chrome, and it still wouldn't expand. Perhaps I'm missing something... |
|
![]() Posts: 7 Reputation: +7 Joined: 2021-07-25 |
Posted 2022-01-08 20:40
|
![]() |
If you're talking about the links in my message, that's because they are the AJAX requests done by the client-side JavaScript code, which will them put the response into the main page (probably using innerHTML, which is usually a bad idea anyway). In other words, any onclick event from those links are actually handled by the main page. Look what I mean: [img]https://i.imgur.com/b9wp6ZP.mp4[/img] ← Trying to add a short video, but this forum doesn't seem to support it. Also, one of the requests is POST, probably to bypass any cache, because it works just fine as GET. |
|
![]() Posts: 1097 Reputation: +135 Joined: 2018-04-08 |
Posted 2022-01-09 00:15
|
![]() |
Oh, you were looking at https://cityofbadgers.com/Leaderboard/... I was looking at https://cityofbadgers.com/Leaderboard/GridContent?archetypeID=&blockID=&globalName=Hivan this whole time! :D Thank you for the video though, really useful! (no wonder that function wasn't there :facepalm: ) I will look at it once more ^_^ |