geonames-client
geonames-client copied to clipboard
Added url as 3rd param
If you have a commercial service, you can buy a custom subdomain. The url isn't changable from outside, so I have added a 3rd param.
Hey @georgfranz and welcome to the GeoNames Client! I suggest making the 3rd parameter an associative array so we can add various config options without breaking the interface or introducing many setter/getter functions. wdyt?
Here are the specs from GeoNames:
Yes the domain should be configurable, also the free api support various domain names (example. secure.geonames.org or api.geonames.org)
Premium users have additionally the possibility to add a parameter 'token' to all requests. This is a security feature to make sure nobody else is using the username (such as former employees...)
Best-Availability users have a failover url they could use if the primary end point for a reason is not reachable. Optimally the client library supports this and if some calls in a row end in a timeout it switches for some hours to the failover server. However, this might be too complicate for you to implement, just keep the possibility in mind that the users of your library may want to change the endpoint programmatically without having to restart their application.
Hey @georgfranz and welcome to the GeoNames Client! I suggest making the 3rd parameter an associative array so we can add various config options without breaking the interface or introducing many setter/getter functions. wdyt?
Hi @Aternus - thanks for your fast reply :-)
Well, what other options do you have in mind? Like langunage / sorting / bias etc.?
Currently I can set all other options from outside - only the url wasn't possbile.
Best, Georg
@georgfranz here's the spec I was thinking about:
- Ability to specify
apiUrl
- Ability to specify
fallbackApiUrl
- Ability to specify
connectionTimeout
(will deprecate the need for the set/get of the timeout) - Ability to specify
fallbackUrlTrigger
. If calls withapiUrl
reachconnectionTimeout
forfallbackUrlTrigger
count, usefallbackApiUrl
for the next call, then reset toapiUrl
and reset the trigger count.
Hello - is this likely to get merged? We're having TLS trouble with secure.geonames & want to use api.geonames instead
Hello - is this likely to get merged? We're having TLS trouble with secure.geonames & want to use api.geonames instead
For us to merge the PR, please kindly ensure:
- The tests for this PR are passing.
- The Spec is implemented. Doesn't have to be everything at once, starting with the associative array having the URL is a good start.