summaryrefslogtreecommitdiff
path: root/local/bin/grab-spot
blob: 3939d72f7793fa19ad1c56223324dfa1b6cb7c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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"