steve8x8 / geotoad

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

TUI: Cannot search, by name, for country or state anymore #348

Closed steve8x8 closed 7 years ago

steve8x8 commented 7 years ago

Searching for a country or state by name doesn't work anymore. Workaround: use the numeric values from the lists provided in the "data" folder.

steve8x8 commented 7 years ago

Commit 7052b9b adds a static list of countries and states. Now it's even possible to search for a state when you don't know the corresponding country - the [country]/[state] search pattern has been generalized. "/" will list all 462 known states, "/th.*r" will find Northern and Southern territories along with Thuringia. (Caveat: Non-ASCII characters may not match properly!)

Now if someone could provide a current list of countries and states (or a strategy how to extract them from the JavaScript code)?

steve8x8 commented 7 years ago

Turns out the code was already there and only needed minor adjustments: Both country and state lists from 2015 have been confirmed to be complete. The default now is to use the list, and save server fetches, but there's a switch in country_state.rb to revert to the old behaviour which now works again, but doesn't allow searches for states over all countries. You may use that if you know that Östergötland is in Sweden (with the new search code, you would be able to just enter "/sterg" instead of "swe/sterg").