Closed steve8x8 closed 8 years ago
Patch merged into git head.
Released with 3.24.0.
Leaving this issue open (although considered resolved) for comments and suggestions.
There's another application of this feature: notification of new caches in the vicinity via Twitter DM.
Basic idea:
Here's the corresponding template that demonstrates usage of the conditionWP expression:
template = {
'twitter' => {
'ext' => 'twt',
'mime' => 'text/plain',
'desc' => 'Twitter-ready',
'templatePre' => "",
# output condition: distance must be <= 10km
'conditionWP' =>
"\"<%out.relativedistancekm%>\".to_f <= 10",
'templateWP' =>
"coord.info/<%out.wid%>" +
" <%out.latdegmin%> <%out.londegmin%>" +
" <%out.nuvi%>" +
" \"<%wpText.name%>\" by <%wpText.creator%>" +
" (<%out.cdateshort%>)" +
" <%out.relativedistancekm%>" +
"\n"
},
}
The link is clickable; nuvi has been used here to keep the cache characteristics short; on the other hand, the coordinates are shown in DD:MM.MMM format for easier map lookups (but one could also use the wp.latwritten and wp.lonwritten DD.DDDDD representations). You're free to write your own templates!
After 3.25.0 release, closing.
The "wherigo" output format, in its current state, lists nonsensical information for all found WIDs. It should be limited to caches whose "type" is "wherigo". This could be achieved by adding another value to the template, checking for "\"<%wp.type%>\" == \"wherigo\"" as a precondition for templateWP output. There might be other usage cases as well, any suggestions?