archived-bot
archived-bot copied to clipboard
Weather command not parsing location names with spaces
Fixing issue reported by user, #495
The regex still won't work for town names containing characters that are not A-Z, for instance:
Tjæreborg
São Paulo
Москва
Clermond-Ferrand
東京
You might also need to trim() the string as well
You might also want to target the sentinel branch, as this file has been migrated to Kotlin
@Frederikam I feel like migration to kotlin for this change can be on a separate pr. I created this pr intended to fix the issue with spaces in the query
I don't think openweather support searching 東京
Perhaps not, but query parameters needs to be URL encoded. I don't know if the URL builder handles that
@Frederikam It does, https://square.github.io/okhttp/3.x/okhttp/okhttp3/HttpUrl.Builder.html#addQueryParameter-java.lang.String-java.lang.String-
Is it just me or does this look like a good case for a unit test?
The API does not seem to support 東京 or Clermond-Ferrand, but the others work when using curl
The latest commit supports the other ones except those two. Do you want me to add tests to it? or proceed with integrating with kotlin/sentinel branch?
If I were you I would migrate to sentinel. I have developed an API to run integration tests on commands that you can use