Hitchwiki / hitchwiki

The Hitchhiker's Guide to Hitchhiking the World
https://hitchwiki.org
32 stars 9 forks source link

Avoid Geonames request throttle in HWFindNearbyCityApi #126

Closed omelnyk closed 7 years ago

omelnyk commented 7 years ago

Geonames allows up to 2000 requests per hour, and that limit is hit early on during spot migration.

Caching won't solve the problem, as all the requests during spot migration are unique and won't have to be repeated again.

Solution I have in mind is to sign up for multiple Geonames accounts, and then use a random one for each request.

As $hwConfig['vendor']['geonames_username'] is used in a handful of places, it's better to do the random pick in configs/mediawiki.php and store it in the same variable.