commit ed83626ee5b0713cfe1e2fe1c093cdb19d8cdc5d
parent 747f2681ae384322ed0feaa0b3e764dd6770ced4
Author: Aaron Bieber <deftly@gmail.com>
Date: Tue, 3 Feb 2015 10:18:44 -0700
allow custom geoip server to be set and specify protocol used
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -46,6 +46,7 @@ Example : `~/.ansiweatherrc`
location:Moscow,RU
fetch_cmd:ftp -V -o -
+ geo_api_url:www.telize.com/geoip
units:metric
daylight:true
@@ -125,6 +126,15 @@ Default : `%a %b %d`
Default : `%b %d %r`
+### GeoIP URL
+
+Set the url for getting GeoIP data (must return json).
+
+ geo_api_url:www.telize.com/geoip
+ geo_api_proto:https
+
+Default : `http://www.telize.com/geoip`
+
## License
AnsiWeather is released under the BSD 3-Clause license. See `LICENSE` file
diff --git a/ansiweather b/ansiweather
@@ -53,7 +53,9 @@ fi
###[ Auto-Location Logic ]####################################################
-geo_locate_api="http://www.telize.com/geoip" #geo location service
+geo_locate_proto=$(get_config "geo_api_proto" || echo "http")
+geo_locate_api=$(get_config "geo_api_url" || echo "www.telize.com/geoip") #geo location service
+geo_locate_api="${geo_locate_proto}://${geo_locate_api}"
function auto_locate {
ret=""