+ Moved rateUSD.sh to .local/bin (To save up even more word count)

This commit is contained in:
ziro 2020-05-19 06:05:36 +07:00
parent db0be00c2a
commit cda9be2bf2
5 changed files with 8 additions and 12 deletions

View file

@ -82,6 +82,7 @@ else
Plug 'ptzz/lf.vim'
Plug 'rbgrouleff/bclose.vim'
endif
Plug 'tpope/vim-commentary'
call plug#end()

View file

@ -6,7 +6,7 @@
# MOTDs
pfetch
echo "--------------------------------------"
sh ~/.scripts/rateUSD.sh
rateUSD
#python ~/Currency/USD2IDR/rate.py #PYTHON IS JUST TOO SLOW FOR TERMINAL
#sh ~/.scripts/motd.sh

View file

@ -86,12 +86,5 @@ alias cmatrix='unimatrix -n -s 96 -l 'o''
alias cdclg='cd "$HOME/my Files/Kuliah/"'
#Git Aliases
alias gcl='git clone'
alias gs='git status'
alias gaa='git add --all'
alias gcm='git commit -m'
alias gca='git commit -a'
alias gcam='git commit -a -m'
alias gp='git push'
alias gR='git restore'
alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'

6
.local/bin/custom/rateUSD Executable file
View file

@ -0,0 +1,6 @@
# get rate value from cnbcindonesia.com
[ ! "$(stat -c %y ~/.cache/rateUSD.txt 2> /dev/null | cut -d' ' -f1)" = "$(date "+Y-%m-%d")" ] &&
curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > ~/.cache/rateUSD.txt
# display rateUSD.txt while replace mark_val with Kurs USD -> IDR:
sed 's/mark_val/Kurs USD -> IDR:/' ~/.cache/rateUSD.txt; echo "Sumber: CNBC Indonesia"

View file

@ -1,4 +0,0 @@
# get rate value from cnbcindonesia.com
[ ! -f /tmp/rateUSD.txt ] && curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > /tmp/rateUSD.txt
# if rateUSD.txt exist then display it while replace mark_val with Kurs USD -> IDR:
[ -f /tmp/rateUSD.txt ] && sed 's/mark_val/Kurs USD -> IDR:/' /tmp/rateUSD.txt; echo "Sumber: CNBC Indonesia"