magma1447 / greasemonkey-geocaching-projectgc

Adds links and data to Geocaching.com to make it collaborate with Project-GC.com
MIT License
18 stars 14 forks source link

Caches can't be added to VGPS from browser map #147

Closed PleuPleu closed 1 year ago

PleuPleu commented 1 year ago

When clicking on a cache in the browse map (https://www.geocaching.com/map) the script shows an option to add a cache to a vGPS but this does not work.

This issue was reported in the Q&A-system of the main site, I'm not sure it's worth spending time on fixing the issue. If it's a big issue I would suggest to just remove the option/icons/etc from the browse map.

Original report: https://project-gc.com/qa/?qa=28541/cache-is-not-added-to-virtual-gps

cghove commented 1 year ago

Don't have time off work to check out my thought on this, but could it be that the script isn't able to fetch the GC-code, due to changes in the div structure on geocaching. com?

rteitelman commented 1 year ago

I don't see any issue related to the greasemonkey script. From the cache map, If I click on a cache, I see an option to add it to a gc.com list but not the project-gc Virtual GPS. See my screen shot. Am I misinterpreting something? Screenshot 2022-12-12 182527

magma1447 commented 1 year ago

There is code to show a VGPS Selector for the map, so the functionality has existed. There could potentially be multiple issues with that part though.

Function Page_Map().

PleuPleu commented 1 year ago

The selector shows in Chrome and Brave (chromium), it does not show in Firefox.

magma1447 commented 1 year ago

I can confirm, I get the selector in my Chrome, on https://www.geocaching.com/play/map . Adding to list doesn't work though. Which makes me assume that the only issue is to parse the GC-code which should be fairly easy to fix. But that's a pure guess.

https://www.geocaching.com/play/map doesn't have any implementation at all. A similar behavior could very well be added to the left pane as a supplementary feature.

magma1447 commented 1 year ago

The patch I made work once, then the gccode it tries to add is something weird. I added a console.log for debug and the output from first adding one, and then another ended up like this:

GC9FJK9
GC8FDJJGC9HHZW

Not sure I manage to fix that right now, but if no one else fixes it today I probably will.

$('#gmCacheInfo div.code').text() actually is GC8FDJJGC9HHZW. Maybe we'll need to grab it from somewhere else. :)