#!/bin/sh
#

filename="/tmp/kabu.txt"
mysqlpass="hogehoge"

datej=`/bin/date +%Y%m%d`
timej=`/bin/date +%H%M%S`

#
# HSI
#
name="HSI"
wget --quiet -O $filename "http://hk.finance.yahoo.com/"
nedan=`grep "mini-indices-table" $filename | sed -e s/" "//g | \
sed -e s/">"//g|sed -e s/"<"//g|sed -e s/"\""//g | \
sed -e s/class=c2/" "/g | sed -e s/tdtdclass=c3/" "/g | \
awk '{print $2}' | sed -e s/,//g |sed -e s/"\/"//g`

echo $name $nedan

/usr/local/bin/mysql kabu -u root --password=$mysqlpass -e \
"insert into toushin \
(bunrui,name,date,time,kagaku) values \
('ETF','$name',$datej,$timej,$nedan)"