Closed GoogleCodeExporter closed 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
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
Original issue reported on code.google.com by
Steve8x8
on 31 Dec 2011 at 10:47