# HG changeset patch # User nanaya # Date 1528463311 -32400 # Node ID 4391020b8ebd11cceb7f3e8f38dff06b4bd0e0f0 # Parent 72ee98d173a4dea6e1ac5e2cb8cf1c75efd232f6 Update latest bni structure diff -r 72ee98d173a4 -r 4391020b8ebd bni-update --- a/bni-update Wed Aug 03 22:49:36 2016 +0900 +++ b/bni-update Fri Jun 08 22:08:31 2018 +0900 @@ -6,8 +6,13 @@ PATH="${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" _outdir="$(dirname "${0}")" +_outfile="bni-jpyidr.txt" -curl -s http://bni.co.id/informasivalas.aspx \ - | grep JPY \ - | sed -e 's/[^0-9]*\([0-9][0-9.]*\)[^0-9].*/\1/' \ - > "${_outdir}/bni-jpyidr.txt" +curl -s http://www.bni.co.id/id-id/beranda/informasivalas \ + | grep -F 'JPY' \ + | tail -1 \ + | sed -e 's/.*JPY<\/td>\([0-9,.]*\)<\/td>.*/\1/' \ + | sed -e 's/,/./' \ + > "${_outdir}/${_outfile}.new" + +mv "${_outdir}/${_outfile}.new" "${_outdir}/${_outfile}"