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

Macro Help (gcapi2) please. by Kai Team - 2019-04-13

$
0
0
The DeleteIgnoreIgnore macro is on my list to update, but it is not yet updated. Part of the reason why is that using json in PUT or POST always makes my head hurt - i.e. it always seems to be trial and error. For example, I think this should work (dummy GC code here, but real codes used in testing):

GSK
$status=GCAPI2("lists/ignore/geocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
   "geocache": "GC1234"
}
<enddata>

But the API responds with:

QUOTE
{"statusCode":500,"statusMessage":"InternalServerError","errorMessage":"Invalid Geocache Reference Code",

I'm sure there's a problem with the way I constructed the json data variable, but I'll need more coffee (or someone else's help) to figure out what I've done wrong.

Is there an 'offline' mode? by D68 - 2019-04-13

$
0
0
Yes, I meant opening the Publish Logs window. smile.gif

Perhaps 'suffer repeated alerts ' was a bit of an exaggeration in normal use but I was having other issues and had to re-import the logs file several times so it seemed like a lot of times... smile.gif

What other ways are there for drafting logs? I wasn't aware of any.

Thanks

M

Macro Help (gcapi2) please. by ian-and-penny - 2019-04-13

$
0
0
QUOTE (Kai Team @ April 13, 2019 07:34 pm)
The DeleteIgnoreIgnore macro is on my list to update, but it is not yet updated.  Part of the reason why is that using json in PUT or POST always makes my head hurt - i.e. it always seems to be trial and error.  For example, I think this should work (dummy GC code here, but real codes used in testing):

GSK
$status=GCAPI2("lists/ignore/geocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
   "geocache": "GC1234"
}
<enddata>

But the API responds with:

QUOTE
{"statusCode":500,"statusMessage":"InternalServerError","errorMessage":"Invalid Geocache Reference Code",

I'm sure there's a problem with the way I constructed the json data variable, but I'll need more coffee (or someone else's help) to figure out what I've done wrong.

Is there more detail on "json" somewhere?

Is there some other way to send the API a list of caches, such as using the $DataList generated from:

GSK
$_sql="Select Code from CachesAll where (SOME FILTER IN HERE)"
$DataList=Sqlite("sql",$_sql)

Is there an 'offline' mode? by Kai Team - 2019-04-13

$
0
0
Few people still use it, but there is a log section in the user notes and a space at the bottom of that dialog to call a Log Cache macro to semi automate uploading the logs.

And I'm sure there are other ways - I have learned never to assume that people are doing things the way I do them. People are quite creative in the way they use GSAK which is why you always should take the time and make the effort to be explicit about what you are doing or asking for. wink.gif

Macro Help (gcapi2) please. by Kai Team - 2019-04-13

$
0
0
QUOTE (ian-and-penny @ April 13, 2019 07:04 am)
Is there some other way to send the API a list of caches, such as using the $DataList generated from:

GSK
$_sql="Select Code from CachesAll where (SOME FILTER IN HERE)"
$DataList=Sqlite("sql",$_sql)

Yes, there is another API call (Add Geocaches to List) for bulk uploading, although if I can't get the single cache method to work, I have little hope of getting the bulk method to work (i.e. to construct a properly formatted "array of strings" from the data list). blink.gif

Publish Logs opens offscreen by pogwog - 2019-04-13

$
0
0
I had this same thing happen for a long time. I know about and use a ton of keyboard shortcuts, but I never knew about the ALT+Space one. I'll have to file that away

What I did end up using is the SwitchDualSingleMonitorSettings macro. When I'm at home using just my single screen, I run it and select Single Screen option.

BadgeGen_V4.0 feed back by The CEO - 2019-04-13

$
0
0
QUOTE (RNKBerlin @ April 13, 2019 12:19 pm)
...

As an aside, I have always found this odd: "20 points for finding caches in 15 states OR 5 countries." Personally, I would award points per country, and add a bonus for 25 or 50 or something. But that's just me.

...

The "5 countries OR 15 states" has been chosen to get to a more level playing field for cachers around the world.
In Europe, you can get in your car at 07:00 in the morning, and then have visited 8 countriees by 18:00 (and the other family members in the car still fairly happy tongue.gif )
There have been cachers that did 15 or 16 countries in Europe in 24 hours ohmy.gif biggrin.gif
When you live in USA or Canada or Australia, you have to drive many many miles or better: take an air plane to visit 5 different countries. There the size of the states matches more with the size of the countries in EU.
It will never be exactly the same, but it was the best that could be done.

Macro Help (gcapi2) please. by sbeelis - 2019-04-13

$
0
0
QUOTE (Kai Team @ April 13, 2019 12:34 pm)
The DeleteIgnoreIgnore macro is on my list to update, but it is not yet updated. Part of the reason why is that using json in PUT or POST always makes my head hurt - i.e. it always seems to be trial and error. For example, I think this should work (dummy GC code here, but real codes used in testing):

GSK
$status=GCAPI2("lists/ignore/geocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
   "geocache": "GC1234"
}
<enddata>

But the API responds with:

QUOTE
{"statusCode":500,"statusMessage":"InternalServerError","errorMessage":"Invalid Geocache Reference Code",

I'm sure there's a problem with the way I constructed the json data variable, but I'll need more coffee (or someone else's help) to figure out what I've done wrong.

Looking at the documentation:

user posted image

The body expects a JSON object containing a field named "geocache" of the type "Geocache".
The geocache object contains various fields, among others "referenceCode" which is a string.

So your code should probably look like this (though I have not tested this):

GSK
$status=GCAPI2("lists/ignore/geocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
   "geocache": {
       "referenceCode": "GC1234"
   }
}
<enddata>


Similarly, using the bulk interface, the code expects an array of gccodes, so the code should probably look something like this:

GSK
$status=GCAPI2("lists/ignore/bulkgeocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
   "geocacheCodes": [
       "GC1234",
       "GC5678",
       "GC9012"
   ]
}
<enddata>


Macro Help (gcapi2) please. by Kai Team - 2019-04-13

$
0
0
Thanks for trying to help, but this:

GSK
$status=GCAPI2("lists/ignore/geocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{
  "geocache": {
      "referenceCode": "GC1234"
  }
}
<enddata>

still produces Status Code 500: "Invalid Geocache Reference Code", which is why json gives me a headache. Life would be so much easier if Groundspeak would add properly formatted examples to the documentation.

PS - among others, I'm using https://coord.info/GC81E1X for testing, which is an active geocache.

Fehler beim Statusabruf by stoeckheim - 2019-04-13

$
0
0
OK, ich verstehe.
Aber dann hat sich das Verhalten doch geändert zu vorher.
Denn bisher war der Statuscheck das Mittel der Wahl, um archivierte aus meiner DB zu entfernen, ohne meinen Fundstatus zu verändern.
Unklar ist mir trotzdem, warum ein Lock plötzlich nicht mehr wirkt. Für mich ist das ein Fehler.
GSAK sollte die gelockten Caches einfach überspringen und nicht den Fundstatus ändern.
Dann ist die Wirkung des Lock ja bei der Statusprüfung obsolet.
Wenn ich eine neue Query einlese, wird der allerdings berücksichtigt.

Kann der Schalter "Found Status Update Options" eventuell auch helfen?

Viele Grüße

Macro Help (gcapi2) please. by ian-and-penny - 2019-04-13

$
0
0
So how can I reformat the output of a filter, (from my example above) into a JSONLIST

GSK
$_sql="Select Code from CachesAll where (SOME FILTER IN HERE)"
$DataList=Sqlite("sql",$_sql)


If $Datalist contains:
GC1234
GC5678
GC9012

I think it will need to be reformatted to look like:

<data> VarName=$jsonlist
{
"geocacheCodes": ["GC1234","GC5678","GC9012"]
}
<enddata>

Or perhaps just:
<data> VarName=$jsonlist
"geocacheCodes": ["GC1234","GC5678","GC9012"]
<enddata>

FindStatGen 4.5 release support thread by ivans - 2019-04-13

$
0
0
I do have two questions.

1. Some Numbers section: Three maps (Most Countries in a day, Maximum distance in a day and Cache centroid) are all time open and I cannot close it. The same behavior is in the Google Chrome, MS Edge and MS IE. I also erased history in browsers, no change.
Do you have any idea how to have closed these maps in the statistics?

2. Missing flag: Andorra flag is missing everywhere, i.e. in the number of finds in the World and in Europe, also in the First Cache By Country section. This flag is missing in Google Chrome only, but it is displayed in the MS Edge and MS IE.
What is wrong in this case with Google Chrome, please?

Thanks for this great macro
ivans

Macro Help (gcapi2) please. by HHL - 2019-04-13

$
0
0
This works for me (tested):

GSK
$data = $d_code
MFilter Where=code=$data


IF YesNo("Put Cache »$d_name« on Ignore List?")
 $jsonlist = Replace("~~GCcode~~","$d_code",$jsonlist)
 $data = gcapi2("lists/ignore/geocaches/","POST",$jsonlist)
ENDIF  

<Data> VarName=$jsonlist
{"referenceCode":"~~GCCode~~"}
<enddata>

Macro Help (gcapi2) please. by ian-and-penny - 2019-04-13

$
0
0
QUOTE (HHL @ April 13, 2019 10:43 pm)
This works for me (tested):

GSK
$data = $d_code
MFilter Where=code=$data


IF YesNo("Put Cache »$d_name« on Ignore List?")
 $jsonlist = Replace("~~GCcode~~","$d_code",$jsonlist)
 $data = gcapi2("lists/ignore/geocaches/","POST",$jsonlist)
ENDIF  

<Data> VarName=$jsonlist
{"referenceCode":"~~GCCode~~"}
<enddata>

Thanks Hans.
Can you show an example of adding a list of caches please?

Macro Help (gcapi2) please. by HHL - 2019-04-13

$
0
0
QUOTE (ian-and-penny @ April 13, 2019 03:54 pm)
[...]
Can you show an example of adding a list of caches please?

No, not yet. I'm still happy to get this code to run for one single cache. And actually, I do not have a need for bulk uploading caches to my Ignore List. I'm pretty sure that Bob will place an updated version of his macro in the near future. wink.gif

Hans

Macro Help (gcapi2) please. by Kai Team - 2019-04-13

$
0
0
QUOTE (HHL @ April 13, 2019 09:43 am)
This works for me (tested):

GSK
$data = $d_code
MFilter Where=code=$data


IF YesNo("Put Cache »$d_name« on Ignore List?")
 $jsonlist = Replace("~~GCcode~~","$d_code",$jsonlist)
 $data = gcapi2("lists/ignore/geocaches/","POST",$jsonlist)
ENDIF  

<Data> VarName=$jsonlist
{"referenceCode":"~~GCCode~~"}
<enddata>

Thanks Hans. As usual, I was overcomplicating the json. rolleyes.gif

FindStatGen 4.5 release support thread by The CEO - 2019-04-13

$
0
0
QUOTE (ivans @ April 13, 2019 04:21 pm)
...

2. Missing flag: Andorra flag is missing everywhere, i.e. in the number of finds in the World and in Europe, also in the First Cache By Country section. This flag is missing in Google Chrome only, but it is displayed in the MS Edge and MS IE.
What is wrong in this case with Google Chrome, please?

..

Try disabling your AD-blocker.
The flag for Andorra is AD.gif, which to the adblcoker looks like an Ad(vertisement) it should block.

Macro Help (gcapi2) please. by lignumaqua - 2019-04-13

$
0
0
QUOTE
Can you show an example of adding a list of caches please?

Probably, untested:

GSK
$status=GCAPI2("lists/ignore/bulkgeocaches","POST",$jsonlist)
<data> VarName=$jsonlist
{[
      "GC1234",
      "GC5678",
      "GC9012"
  ]
}
<enddata>

FindStatGen 4.5 release support thread by lignumaqua - 2019-04-13

$
0
0
QUOTE (ivans @ April 13, 2019 09:21 am)
1. Some Numbers section: Three maps (Most Countries in a day, Maximum distance in a day and Cache centroid) are all time open and I cannot close it. The same behavior is in the Google Chrome, MS Edge and MS IE. I also erased history in browsers, no change.
Do you have any idea how to have closed these maps in the statistics?

You can't. Geocaching.com removed the ability to use any JavaScript on the Profile Page.

Get Caches Along a Route - Beta by arminus - 2019-04-13

$
0
0
Is anyone working on a google independent version of this macro yet?
Viewing all 75149 articles
Browse latest View live