Skip to content

Instantly share code, notes, and snippets.

@clyfish
Created February 23, 2017 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clyfish/f602429bc221556fd12d4e0e337b3ab0 to your computer and use it in GitHub Desktop.
Save clyfish/f602429bc221556fd12d4e0e337b3ab0 to your computer and use it in GitHub Desktop.
#!/bin/bash
while :
do
price=`curl --compress -se "http://m.cngold.org/home/dy110.html" "http://api.jijinhao.com/realtime/quotejs.htm?codes=JO_71" | grep -oP '(?<="q63":")[^"]+'`
s=`bc <<< "$price * 113.2546 - 30000"`
p=`bc <<< "scale=2; ($price - 264.89) / 2.6489"`
echo "| `date +%H:%M` | $price | $s | $p%"
echo -ne '\033]2;'"$price $s $p%"'\007'
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment