+ Added scripts directory
This commit is contained in:
parent
c42020a930
commit
08332199a2
23 changed files with 547 additions and 0 deletions
12
.scripts/rateUSD.sh
Normal file
12
.scripts/rateUSD.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
if [ ! -f /tmp/rate.html ]; then
|
||||
curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" > /tmp/rate.html
|
||||
fi
|
||||
if [ ! -f /tmp/rateUSD.txt ]; then
|
||||
cat /tmp/rate.html | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > /tmp/rateUSD.txt
|
||||
sed -i "s/mark_val/Kurs USD -> IDR:/g" /tmp/rateUSD.txt
|
||||
cat /tmp/rateUSD.txt
|
||||
echo "Sumber: CNBC Indonesia"
|
||||
else
|
||||
cat /tmp/rateUSD.txt
|
||||
echo "Sumber: CNBC Indonesia"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue