comparison bni-update @ 15:4391020b8ebd

Update latest bni structure
author nanaya <me@nanaya.pro>
date Fri, 08 Jun 2018 22:08:31 +0900
parents a696cc8f1ee1
children
comparison
equal deleted inserted replaced
14:72ee98d173a4 15:4391020b8ebd
4 set -u 4 set -u
5 5
6 PATH="${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" 6 PATH="${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"
7 7
8 _outdir="$(dirname "${0}")" 8 _outdir="$(dirname "${0}")"
9 _outfile="bni-jpyidr.txt"
9 10
10 curl -s http://bni.co.id/informasivalas.aspx \ 11 curl -s http://www.bni.co.id/id-id/beranda/informasivalas \
11 | grep JPY \ 12 | grep -F '<td class="align-center">JPY</td>' \
12 | sed -e 's/[^0-9]*\([0-9][0-9.]*\)[^0-9].*/\1/' \ 13 | tail -1 \
13 > "${_outdir}/bni-jpyidr.txt" 14 | sed -e 's/.*<td class="align-center">JPY<\/td><td class="align-right">\([0-9,.]*\)<\/td>.*/\1/' \
15 | sed -e 's/,/./' \
16 > "${_outdir}/${_outfile}.new"
17
18 mv "${_outdir}/${_outfile}.new" "${_outdir}/${_outfile}"