Yes, it also means I am going to have to add a proccess for users to update the URL field for all Adventure and Lab Stage waypoints from 'https://adventurelab.page.link/$coreCode' to 'https://labs.geocaching.com/goto/$accessCode'.
Unfortunately, that is going to require an API call for every Adventure in the Users database in order to get the $accessCode. Pain of pains
When will Groundspeak ever stop fiddling with this API and breaking everyones code continuously?
If they want to keep the Adventure App as the only way to deal with playing Adventures, then they should have not given us an API.
When they next decided to make Lab Stages count as a geocache find, that was their next big mistake. It is because of this poor decision that we go to the effort of creating these Lab Stages in GSAK so that users can plan their Geocaching trips to combine Caches and Labs into sensible routes etc. and so we can help users keep a tally of their combined finds.
The very least they can do is give us a means of getting the coreCode so that we do not have to invent a new way of creating a truley unique coreCode.
Unfortunately, I am not holding much hope that they are going to do that so the next challenge will be inventing the coreCode.
Rant over.
Start thinking about that challenge because we are going to need a solution.
The winning solution would be to find out how Groundspeak create their coreCode!
I know Mike is looking at possibilities.
I think it must be a process that either converts the Adventure Id (This is not its GUID) or the access code that is used in the deeplink.
I was playing with some JavaScript (Which can be duplicated in a GSAK macro) that does give a four character result.
This involved scraping the Adv Id, which is not approved but in the case of the example I have used above, it is 366590.
If you copy this JavaScript and paste it into a test.html file and view it in your browser, you will get a couple of messages showing you the conversion both ways.
| HTML |
<h1>Generating a Core Code</h1>
<script> const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
function numToCode(num) { let code = ""; while (num > 0) { let rem = num % 62; code = alphabet[rem] + code; num = Math.floor(num / 62); } while (code.length < 4) { code = alphabet[0] + code; } return code; }
function codeToNum(code) { let num = 0; for (let i = 0; i < code.length; i++) { num = num * 62 + alphabet.indexOf(code[i]); } return num; }
// Example alert(numToCode(366590)); // BhWu alert(codeToNum("BhWu")); // 366590 </script>
|
If Groundspeak use this method then they are probably using a unique alphabet, such as "The quick brown fox jumps over the lazy dog"
However, I think I am barking (pardon the pun) up the wrong tree and it is more likely that they convert the access code (In the deeplink: baa2a8c1-44d2-49ac-957f-8cd62f74088e) to get a unique coreCode. Which we can get through the API.