mirsch / lab2gpx

GNU General Public License v3.0
26 stars 21 forks source link

Switch to /Api/Adventures/SearchV4 API #114

Closed Juhaz closed 5 months ago

Juhaz commented 1 year ago

V3 api is marked as deprecated and will likely stop working some time in the future.

V4 api would also allow the possibility to filter by completion statuses by including the user's public guid in the request without nasty kludges like copypasting the logs page html.

mirsch commented 1 year ago

I saw that but have no idea how an average user is supposed to get their id. Any idea how to get the public guid of the user?

Herr-Ma commented 1 year ago
  1. Goto your (new) user profile: https://www.geocaching.com/p/
  2. Look in the source code of the page, you can found someting like the following:

window['chromeSettings'] = { "isAuthenticated": true, "paymentUrl": "https://payments.geocaching.com", "planUrl": "", "gameplayUrl": "", "mainElementId": "Content", "mapUrl": "", "locale": "en-US", "inlinePostfix": "--inline", "publicUrl": "https://www.geocaching.com", "hostname": "https://www.geocaching.com", "accountId": "xxxxxx", "username": "Herr Ma", "findCount": 33633, "hideCount": 49, "avatarUrl": "https://img.geocaching.com/avatar/5be8127d-32c0-4bb0-84e2-b5e4ab266776.jpg", "isBasic": false, "showDoNotSell": false, "showRenew": false, "userPublicGuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "dateJoined": "2010-05-01T03:11:15.65", "isValidated": true, "membershipLevel": "Premium" }; window['userRef'] = 'PR3YGE1';//]]>

mirsch commented 1 year ago

Easy enough. Would be great progress for sure. Unfortunately I don't have enough time for that at the moment.

Juhaz commented 1 year ago

doesn't even have to be your profile, I think every page on geocaching.com has the window['chromeSettings'] object when you're logged in.

For even less technical way, the link to your username in logs or cache owner points to https://www.geocaching.com/profile/?guid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx

Juhaz commented 1 year ago

Easy enough. Would be great progress for sure. Unfortunately I don't have enough time for that at the moment.

I'm deathly allergic to PHP but can try and see if I can wrangle with it enough for a PR 😅️

mirsch commented 1 year ago

I'm deathly allergic to PHP but can try and see if I can wrangle with it enough for a PR sweat_smile

you are free to rewrite it in a language of your choice ;p

Juhaz commented 1 year ago

you are free to rewrite it in a language of your choice ;p

Tempting, but I don't think fragmentation is good either so tried to come up with something :smiley: