steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

Wishlist: bookmark lists #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are quite a few users who keep so-called "bookmark lists", like
- night caches 
http://www.geocaching.com/bookmarks/view.aspx?guid=cbb21edf-fb9e-45b5-9b27-c51fd
6453cbf
- "conflux" (lat/lon grid) points
- "chirp" caches
etc. - just google for '"bookmark lists" site:geocaching.com' ... (300,000+ 
results!)

And there's a tradition in some places e.g. to spend the longest night of the 
year... you guessed it: night-caching.

Although that occasion has now gone, what about having another --query option 
"list" (or "bookmark") to be prepared for the next one?

Right now, I only know "guid=" selections, but there may be other ones.
There's also (unlike in /seek/ pages) an option to raise the number of shown 
cache entries (up to 1000), but the "continuation page mechanism" seems to be 
the same as with seeks AFAICT now.

Opinions? Additional info?

Original issue reported on code.google.com by Steve8x8 on 31 Dec 2011 at 10:47

GoogleCodeExporter commented 9 years ago
When "guid" queries are available (issue 228), a possible solution would be the 
following scriptlet, yielding a guid list. (Quick and dirty, but you get the 
idea.)

--- 8< snip ---
#!/bin/bash
# $1 = list guid
lynx -source http://www.geocaching.com/kml/bmkml.aspx?bmguid=$1 \
| tee bookmarks.kml \
| perl -ne '
    if(/\?guid=([0-9a-f-]+)/){
        $guid=$1;printf("%s %.6f %.6f %s\n",$guid,$lat,$lon,$name);
    }
    if(/<name>(.*)<\/name>.*?([0-9.-]+),([0-9.-]+),/){
        $name=$1; $lon=$2; $lat=$3;
    }
  ' \
| tee bookmarks.list \
| while read guid lat lon name
do
  echo -n "$guid:"
done
--- 8< snap ---

(giving you a couple of intermediate files to play with)
or even shorter (if you don't need the intermediate files)

--- 8< snip ---
#!/bin/bash
# $1 = list guid
lynx -source http://www.geocaching.com/kml/bmkml.aspx?bmguid=$1 \
| perl -ne 'if(/\?guid=([0-9a-f-]+)/){printf("%s:",$1);}'
--- 8< snap ---

(Of course HTTP could be done within Perl, too...)

Then pass the guid list to "geotoad ... --query guid" ...

Original comment by Steve8x8 on 31 Dec 2011 at 11:40

GoogleCodeExporter commented 9 years ago
Merging into issue 228. There'll be an addition tho the "OtherSearches" wiki 
page when the fix for that issue has been rolled out.

Original comment by Steve8x8 on 20 Jan 2012 at 12:20