diff options
author | David Phillips <david@sighup.nz> | 2017-03-05 15:17:45 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-03-05 15:17:45 +1300 |
commit | 9326c9f10541e83da5e525c1e001e75f5cd1f56e (patch) | |
tree | 1ddf480d142abf64e4d9e80f96429f111712208a /local/bin/grab-spot | |
parent | f8d2ed355eaef3a7a4e86a60fb8a998b4942e754 (diff) | |
download | dotfiles-9326c9f10541e83da5e525c1e001e75f5cd1f56e.tar.xz |
Add currency spot price util
Diffstat (limited to 'local/bin/grab-spot')
-rwxr-xr-x | local/bin/grab-spot | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/local/bin/grab-spot b/local/bin/grab-spot new file mode 100755 index 0000000..3939d72 --- /dev/null +++ b/local/bin/grab-spot @@ -0,0 +1,13 @@ + +if [ -z $1 ]; then + logger "$0: blank FROM currency" + exit +fi +if [ -z $2 ]; then + logger "$0: blank TO currency" + exit +fi + +rate=$(curl "http://rate-exchange-1.appspot.com/currency?from=$1&to=$2" | jshon -e rate) + +echo "$1$2: $rate" > ~/.cache/"$1$2" |