Last active
August 29, 2015 14:11
-
-
Save mksh/61394774f4784e887cc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch fin_info.txt | |
xterm -e bash -c "sleep 2 && watch -n 1 'tail -n10 fin_info.txt' " | |
while [ 1 -eq 1 ] | |
do | |
date=`date +"%Y/%m/%d %H:%M"` | |
eur=$(wget --load-cookies=cook_b --save-cookies=cook_b --keep-session-cookies -q 'http://ru.investing.com/currencies/usd-rub' -O - | grep -A 3 'last_last' | tr -d '\n' | awk -F '>' '{print $2,$4,$8}' | awk -F '<' '{print $1,$2,$3}' | awk '{print $1,$3,$5}') | |
rub=$(wget --load-cookies=cook_r --save-cookies=cook_r --keep-session-cookies -q 'http://ru.investing.com/currencies/eur-uah' -O - | grep -A 3 'last_last' | tr -d '\n' | awk -F '>' '{print $2,$4,$8}' | awk -F '<' '{print $1,$2,$3}' | awk '{print $1,$3,$5}') | |
usd=$(wget --load-cookies=cook_u --save-cookies=cook_u --keep-session-cookies -q 'http://ru.investing.com/currencies/usd-uah' -O - | grep -A 3 'last_last' | tr -d '\n' | awk -F '>' '{print $2,$4,$8}' | awk -F '<' '{print $1,$2,$3}' | awk '{print $1,$3,$5}') | |
echo "$date \t USD/RUB: $eur UAH/EUR: $rub UAH/USD: $usd" >> fin_info.txt | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment