Jump to content

Find a word in a geocache log?


Cryptid

Recommended Posts

I’m trying to find out if it’s possible do a search for a word in all logs in an area? My idea is to look for the word Pathtag to see if anyone dropped one recently in a geocache nearby. I imagine that GSAK has this, but I’m not near my desktop computer for a while. Is there a GSAK type app available?

Link to comment

I still use GSAK, yeah, I’m old school, GPS user here, been caching since the load every geocache and print out the geocache page days. But this week I’m away from home on a trip, I’m always on the lookout for pathtags, so I was wondering if there was a GSAK type App for IPhone. When I get home I cab GSAK this query, I have the Macro for it. I didn’t get to prepare for this trip tho. 

Link to comment

I'm sure that you could accomplish this using GSAK. But since I don't use/have GSAK, here is an alternative.

 

You could run a Pocket Query for caches in your area, and then download the .gpx. If you open in up in a text editor (Notepad, Notepad++ if you're on a computer; there are probably equivalent apps for your phone too); you can just do a Ctrl-F search for the term "pathtag", and then scroll up to figure out which caches that log was posted on.

 

gpx(1).thumb.png.9a9526ce6599ffb1d1c1690ccc118b31.png

 

We can see that in geocache "An Ammo Can for Cuddlefish" by hollyburn, the fourth-to-most-recent finder (kinemed) wrote that they "Left a Cuddlefish Pathtag."

 

Obviously this isn't the best solution. For one, it only searches the five most recent logs on every cache (but if you're looking to collect Pathtags this may actually be beneficial, since Pathtags left "many finds ago" may already be taken.) Also, you'll probably want a computer (rather than a phone) to do this, but it can be done.

Edited by Hügh
  • Helpful 1
Link to comment
25 minutes ago, Viajero Perdido said:

Anybody here know XSLT? It's an incredibly hideous programming language (sort of) that could make short work of this with just a few lines of code. I'm not volunteering, sorry, and to discourage requests, my rates will shock you. :ph34r:  Been there, never going back. 

 

GPX + XSLT = result + AAAGH! 

 

That sounds... horrifying. I'll leave it to you to implement that... ;)

 

Personally, I would do this in JavaScript. These days, JavaScript can literally* do anything.

 

const xml = (new DOMParser()).parseFromString(/* .gpx XML here, in one big string */, "text/xml");

xml.querySelectorAll("log").forEach(log => {
	if (log.querySelector("text")?.textContent.toLowerCase().indexOf("pathtag") >= 0) {
		console.log(log.parentElement.parentElement); // perhaps one more .parentElement is necessary
	}
});

 

  • Helpful 1
Link to comment

...in fact, I did it. :D

 

search.thumb.PNG.5722ee336d228137a56855186f07e05c.PNG

 

Upload a .gpx of the geocaches in your area. It'll find all the logs that reference Pathtags, and display the log (as well as the geocache that the log was posted on) in a nice table.

 

The tool runs entirely in your browser; it will not send the .gpx over to my server (I don't have the bandwidth for that!)

 

It is also terrible. I make no guarantees—it may miss some caches (though I will try my best to update it over the new few days.) :D

Edited by Hügh
  • Upvote 1
  • Love 1
Link to comment
On 2/6/2021 at 10:13 PM, Viajero Perdido said:

Anybody here know XSLT? It's an incredibly hideous programming language (sort of) that could make short work of this with just a few lines of code. I'm not volunteering, sorry, and to discourage requests, my rates will shock you. :ph34r:  Been there, never going back. 

 

GPX + XSLT = result + AAAGH! 

 

Yes, I've done a fairly substantial amount of XSLT programming, and yes, it's quite hideous.  I'm primarily a java programmer so I've created some java objects that can be used to map the GPX XML into a java model, then I can transform that into other formats (including a csv file format, or an excel spreadsheet) , store data into a relational database or index cache data into a search index.   

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...