Quantcast
Channel: GSAK Forum
Viewing all 76122 articles
Browse latest View live

Is there a general "copy field1 to field2" macro? by Kai Team - 2025-08-19

$
0
0
SQLite stores dates as strings in the form YYYY-MM-DD. No conversion is necessary if you want to use SQLite to copy a date to text field and you want the date in that format (e.g. '2025-08-19')in your string field.

We can give you the code you requested if you tell us

1) which date you want to retrieve (to avoid confusion, please give us the GSAK variable name, without the $d_ prefix).
2) which field you want to store it in (again, using the GSAK variable name, or the exact name if it's a custom field).
3) What format you want the date to be in, assuing you're storing it in a text field. smile.gif

Copy ignore list from one database to another by Gill & Tony - 2025-08-19

$
0
0
I had a problem with one database, so I renamed it out of the way and rebuilt it from scratch.

Is it possible to copy the ignore list from the old version to the new one?

Thanks

Tony

Copy ignore list from one database to another by The CEO - 2025-08-20

$
0
0
QUOTE (Gill & Tony @ August 19, 2025 11:45 pm)
I had a problem with one database, so I renamed it out of the way and rebuilt it from scratch.

Is it possible to copy the ignore list from the old version to the new one?

Thanks

Tony

It can be done using Sqlite, so you would need to write a macro for that, or try it with SqLiteSpy.
You need both databases open at the same time, so you need to attach the old database while you have the new DB open on your screen.
Then you would use SQL like this:
SQL
INSERT INTO ignore SELECT * FROM attached_db.ignore
where you replace "attached_db" with the name you used when attaching the second (old) DB.

Attaching the DB goes something like this:
GSK
$Path=$_AppData + "\data\"
$File=$Path + "OldDB\sqlite.db3"
$Status=Sqlite("sql","ATTACH '$File' AS attached_db")


And then detach the OldDB when you are done:
GSK
$Status=Sqlite("sql","DETACH attached_db")

Copy ignore list from one database to another by Gill & Tony - 2025-08-20

$
0
0
Thanks for that. I'll sort it out ASAP.

Groundspeak has changed something in Adventure Lab by Gill & Tony - 2025-08-20

$
0
0
I have a macro which adds Adventure labs to a GSAK database.

I used to get the owner ID by doing a GetURL to https://adventurelab.page.link/xxxx where xxx is the 4-digit code for that adventure.

All of a sudden, the GetURL works, but returns a string saying Dynamic Link not found. I tried changing the 4-digit code to the long TD string which looks like 02609fb7-c20b-43f8-b1b8-7d0575c808af but that returns the same error. All my new Placed BY, Owner name and Owner ID fields are now blank.

Does anyone know how to get the owner ID for an adventure now?

Thanks

Tony

Adventure Lab API Access by lignumaqua - 2025-08-20

$
0
0
We were informed today of an upcoming change to the Adventure Labs data available through the API. Specifically, we were told that the firebase dynamic link (dynamicLink) returned as part of the adventure object is obsolete. deepLink is now being returned and should be used instead.

In practice this means the dynamicLink property in the returned JSON will no longer be valid. Instead there will be a new property: deepLink.

For now both values will be the same but eventually, the dynamicLink property will be removed completely, so it's recommended to switch over to the deepLink property.



Groundspeak has changed something in Adventure Lab by Kai Team - 2025-08-20

Groundspeak has changed something in Adventure Lab by Gill & Tony - 2025-08-20

$
0
0
I had read that post, but I don't understand how it relates to my problem.

My understanding is that the dynamic link is the 02609fb7-c20b-43f8-b1b8-7d0575c808af string and the new deeplink has the same value for now.

I wasn't using the string. I was using the 4 character code.

Obviously I'm missing something, so could you please explain how this all fits together? It is over my head at the moment.

Adventure Lab API Access by clan-wallace - 2025-08-20

$
0
0
Unfortunately, I cannot switch to the deeplink property, as currently, it is not available from the Adventure API.

Is there any chance you can get any more information on when that property will be available and how we can access the Adventure page?

Currently a valid URL link is obtained from the firebaseDynamicLink property, for example;
https://adventurelab.page.link/11Fe

In addition, in order to create codes for Adventures and their Lab Stages, this is done by striping the last four case-sensitive characters from the firebaseDynamicLink property, in this case '11Fe', (the core code) to create codes such as AL11Fe, LB11Fe01, LB11Fe02, etc.

Can GS give us an insight into when the firebaseDynamicLink property will no longer be available, what the format of the URL to link to the Adventure page will be and how we will be able to get the core code please?

Thank you for assisting us to prepare for this change.

Adventure Lab API Access by clan-wallace - 2025-08-20

$
0
0
Further to my last:

Here are some details I have been able to establish that may help us make the property switch.

For this example, I will use the 'ALDERMASTON WHARF' Adventure.

The URL I have for this Adventure and all its Lab Stages in my Adventures database is the FirebaseLink
https://adventurelab.page.link/JKpq

The Core code is therfore 'JKpq'.

If I view the source code for that page, I can see the deeplink property, which we now know what the correct format of the URL that will replace the FirebaseLink
https://labs.geocaching.com/goto/baa2a8c1-4...7f-8cd62f74088e

You would have thought (hoped) that the UUID (baa2a8c1-44d2-49ac-957f-8cd62f74088e) would have been the Adventure GUID (No such luck), it is
36590089-2e29-461a-b5af-6ad119703449

So I am assuming that when making a call to our restricted API for the Adventure properties, the FirebaseLink property will be replaced by the Deeplink property and the switch should be painless.

But I don't see where the core code will come from! unsure.gif

Groundspeak has changed something in Adventure Lab by Kai Team - 2025-08-20

$
0
0
Tony - you're creating a parallel thread, which leads to divergent conversations and confusion. Please read the additional posts by clan-wallace (here) and continue the discssion about changes to the AdLab API in that thread. Thank you.

Closing this duplicate thread.

Adventure Lab API Access by lignumaqua - 2025-08-20

$
0
0
The deepLink property will be added on August 25 I’m told.

I believe you are correct that from that date both the dynamicLink and deepLink properties will contain the deepLink value. At some point after that the dynamicLink property will be removed completely.

I’ve put together a page for the staging API doc here https://gsak.net/apistaging.html which shows the new property. (Confusingly it seems to be deepLink in one call and deeplink in another!)

Is there a general "copy field1 to field2" macro? by yukionna - 2025-08-20

$
0
0
Thanks!

1) which date you want to retrieve (to avoid confusion, please give us the GSAK variable name, without the $d_ prefix).

FoundByMeDate

2) which field you want to store it in (again, using the GSAK variable name, or the exact name if it's a custom field).

UserData

3) What format you want the date to be in, assuing you're storing it in a text field. smile.gif

YYYY-MM-DD

Adventure Lab API Access by clan-wallace - 2025-08-20

$
0
0
So the only unknown value will be the core code to allows us to create sensible codes for the Lab waypoints.

Can you ask your contact if they are going to make this unique required value available in our API. Otherwise I cannot see a solution to this for my macros going forward.

For me, it would be sensible to retain the FirebaseLink as is, even though it will no longer link to the Adventure page. Then it would solve our problems and not be a duplicate of the deeplink, which has no use.

Is there a general "copy field1 to field2" macro? by Kai Team - 2025-08-20

$
0
0
This line of code will copy the FoundByMeDate to the UserData for all caches in the current filter (or database, if no filter is set):

GSK
$Status=Sqlite("sql","UPDATE Caches SET UserData=FoundByMeDate WHERE RowID IN(Select * From GridTemp)")

If you don't mind saying, I'm curious why you're doing that, since the FoundByMeDate is already available in the database. unsure.gif

Adventure Lab API Access by lignumaqua - 2025-08-21

$
0
0
To confirm what I think you already know. It appears that the API is already returning the deepLink value for the firebaseDynamicLink property ahead of the Aug 25 date. The JSON property returned by the API for the Aldermaston Wharf adventure is:

CODE
 "firebaseDynamicLink": "https://labs.geocaching.com/goto/baa2a8c1-44d2-49ac-957f-8cd62f74088e"


So even though the contents have changed, the name hasn't changed to deepLink yet.

Adventure Lab API Access by clan-wallace - 2025-08-21

$
0
0
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 wub.gif
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.

UserNote Linefeeds by clan-wallace - 2025-08-21

$
0
0
I have code that creates a large string containing tabs and linefeeds.
This data is then writen to the UserNote.

If I open the UserNote in the GUI, I can see the linefeeds are there and if I copy the data and paste it into a spreadsheet, the data correctly starts at a new row for each line feed and the tabs place the data in the correct cells.

If I use SQL in my macro to select the UserNote, then all the tabs are preserved but the linefeeds have been removed.
Thus, when pasting the data from the clipboard into my spreadsheet, all the data is on one single row.

I can see the help file talks about the <OnlyText> directive but I cannot see how you impliment that.

Is this a known bug?

Will the solution be to write a unique value instead of a newline ($_CrLf) and after selecting the UserNote, replace the unique value with linefeeds?

UserNote Linefeeds by Kai Team - 2025-08-22

$
0
0
No, it's not a bug and basically, yes, you use a substitution. Please see the 'crlfcvt=xxx' option for SQLite on this help page.

A little further down that page (emphasis added):

QUOTE
If you don't include any of these options the defaults are:

1. Remove any delimiters found in the data fields
2. Remove any line feeds found in the data fields
3. Delimiter is ";" (without the quotes)
4. Headings = No
5. Error = Halt

GetAllLogsForUser.gsk feedback thread by Gamma5 - 2025-08-22

$
0
0
QUOTE (The CEO @ April 12, 2015 06:11 am)
QUOTE (mars express @ April 12, 2015 11:36 am)
Hi CEO, what does:
CODE
  34  logs, that were deleted on geocaching.com, already not present in DB

mean?

can I somehow see which logs/caches these are?

These are logs that the user deleted ("archived") on Geocaching.com
The macro will delete these logs from your database, if they are present.
This way users that have problems with more than one found log on a cache in GSAK, while there is only one log on Geocachig.com, can solve this by running the macro.

To see which logs/caches this are:
- Modify the GetAllLogsForUser.gsk macro around line 67, so that it reads:
GSK
#$TempTable = "TEMP" # Use this to have temporary SQL tables Work_logs and Work_Images
$TempTable = ""      # Use this to have normal        SQL tables Work_logs and Work_Images

- Run the GetAllLgsForUser.gsk macro with the desired settings.
- Run the following macro code:
GSK
$_sql = "SELECT Name, '<A HREF="+chr(34)+"http://www.geocaching.com/seek/log.aspx?lid='||LogID||'"+chr(34)+">Link to log</a>' as Link, lText,FullLogDate,LogType,FinderName FROM Work_logs JOIN caches using (code) WHERE lIsArchived='true' "
$status = sqlite("sql" , $_sql, "Headings=yes")
$html = sqltohtml($status,"...","y")

I too am curious on these deleted logs:
CODE
   2  logs, that were deleted on geocaching.com, already not present in DB

I suspect that I may have forgotten to send some answers to earthcaches and the logs were deleted by the owner of the cache and would like to identify them and redeem myself, if I can.

I have modified GetAllLogsForUser.gsk macro around line 67 (line 86 now for MacVersion = 2.89) and have included the suggested macro code in a stand-alone macro, however, I get the following error message:

CODE
Current Macro: D:\GSAKData\macros\New macro.gsk

Error in Macro at line: 10
$status = sqlite("sql" , $_sql, "Headings=yes")

Error=> SQLite3 Error 1 - no such table: Work_logs



First question, is this procedure still valid at MacVersion = 2.89? If so, where am I supposed to use the suggested macro code?

Yvan
Viewing all 76122 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>