summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocal/bin/grab-spot4
-rw-r--r--zshrc1
2 files changed, 4 insertions, 1 deletions
diff --git a/local/bin/grab-spot b/local/bin/grab-spot
index eda284e..a4974f4 100755
--- a/local/bin/grab-spot
+++ b/local/bin/grab-spot
@@ -1,5 +1,7 @@
#!/bin/sh
+# Warning: uses a non-existant currency API
+
# Grabs a spot price for a currency and stores it in ~/.cache
# Useful to run as a cron job and use its cached output in motds or status
# lines
@@ -21,7 +23,7 @@ fi
# Only bother downloading if it's more than 1 hour old
if ([ ! -f ~/.cache/currency/"$1$2" ] || [ $(find ~/.cache/currency/"$1$2" -mmin +60) ]) ; then
- rate=$(curl "http://rate-exchange-1.appspot.com/currency?from=$1&to=$2" | jshon -e rate)
+ rate=$(curl -L "https://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=$1$2=X" | cut -d ',' -f 2)
if [ $? -ne 0 ] ; then
logger "$0: curl error"
exit
diff --git a/zshrc b/zshrc
index 3756c7b..4d121c8 100644
--- a/zshrc
+++ b/zshrc
@@ -54,6 +54,7 @@ RPROMPT='[%?] %w %t'
source /usr/share/git/completion/git-prompt.sh
source ~/.environment
source ~/.aliases
+source ~/.aliases.zsh
echo Running $(uname) $(uname -r) on $(uname -n) \($(uname -m)\)