commit d84960d6ff1591fb2851ca6cb82ce67f2eb75604
parent b2b085892d61d632a166028d53c132019a26052b
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date: Thu, 29 Oct 2015 23:39:22 +0100
Some tweaks and updates regarding OpenWeatherMap API keys
Diffstat:
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
@@ -54,7 +54,6 @@ AnsiWeather packages are available for :
Options are :
- -k API key
-l Specify location
-u Specify unit system to use (metric or imperial)
-f Toggle forecast mode for the specified number of upcoming days
@@ -62,6 +61,7 @@ Options are :
-d Toggle daylight data display
-a Toggle ANSI colors display
-s Toggle symbols display
+ -k API key
-h Display usage
@@ -76,9 +76,6 @@ Any configuration options may also be passed in as command line options :
## Configuration
-Accessing OpenWeatherMap requires an API key. To get a key you must [create an OpenWeatherMap account](http://home.openweathermap.org/users/sign_up).
-It's free.
-
The default config file is ~/.ansiweatherrc. The environment variable
ANSIWEATHERRC can be set to override this. The following configuration options
(detailed below) are available and should be set according to your location and
@@ -86,7 +83,6 @@ preferences.
Example : `~/.ansiweatherrc`
- api_key:X1234567890
location:Rzeszow,PL
fetch_cmd:ftp -V -o -
units:metric
@@ -171,6 +167,12 @@ Default : `%a %b %d`
Default : `%b %d %r`
+### OpenWeatherMap API key
+
+Specify an OpenWeatherMap API key. By default AnsiWeather uses its own key, but users can optionaly get their own one by [creating an OpenWeatherMap account](http://home.openweathermap.org/users/sign_up). It's free.
+
+ api_key:85a4e3c55b73909f42c6a23ec35b7147
+
## License
diff --git a/ansiweather b/ansiweather
@@ -47,7 +47,6 @@ while getopts k:l:u:f:Fd:a:s:h option
do
case "${option}"
in
- k) api_key=${OPTARG};;
l) location=${OPTARG};;
u) units=${OPTARG};;
f) forecast=${OPTARG};;
@@ -55,6 +54,7 @@ do
d) daylight=${OPTARG};;
a) ansi=${OPTARG};;
s) symbols=${OPTARG};;
+ k) api_key=${OPTARG};;
h) usage=true;;
esac
done
@@ -73,7 +73,6 @@ then
"" \
"Options are :" \
"" \
- " -k API key" \
" -l Specify location" \
" -u Specify unit system to use (metric or imperial)" \
" -f Toggle forecast mode for the specified number of upcoming days" \
@@ -81,6 +80,7 @@ then
" -d Toggle daylight data display" \
" -a Toggle ANSI colors display" \
" -s Toggle symbols display" \
+ " -k OpenWeatherMap API key" \
" -h Display usage" \
"" \
"EXAMPLES: ansiweather -l Moscow,RU -u metric -s true -f 5 -d true" \
diff --git a/ansiweatherrc.example b/ansiweatherrc.example
@@ -1,5 +1,6 @@
# .ansiweatherrc example showing all available options
+api_key:85a4e3c55b73909f42c6a23ec35b7147
fetch_cmd:curl -sf
location:Rzeszow,PL
units:metric