commit d871113d67cf5f709638e21200111f9a6c387119
parent 2ebecef13f79f26728a1f1897ca9dbf252274aef
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date: Sat, 19 Sep 2015 22:59:45 +0200
Replacing spaces by underscores in location name before calling weather API (Close #71)
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ansiweather b/ansiweather
@@ -6,7 +6,7 @@
# https://github.com/fcambus/ansiweather #
# #
# Created: 2013/08/29 #
-# Last Updated: 2015/09/14 #
+# Last Updated: 2015/09/19 #
# #
# AnsiWeather is released under the BSD 3-Clause license. #
# See LICENSE file for details. #
@@ -211,6 +211,7 @@ then
weather=$($fetch_cmd "http://api.openweathermap.org/data/2.5/$api_cmd?id=$location&units=$units")
else
# Location is a string
+ location=$(echo "$location" | sed "s/ /_/g")
weather=$($fetch_cmd "http://api.openweathermap.org/data/2.5/$api_cmd?q=$location&units=$units")
fi