#!/usr/bin/env bash unset CDPATH bin=`dirname "$0"` bin=`cd "$bin"; pwd` cygwin=false case "`uname`" in CYGWIN*) cygwin=true;; esac APP_HOME=$bin # some Java parameters PYTHON=`which python 2>/dev/null` if [[ $PY_HOME != "" ]]; then PYTHON=$PY_HOME/bin/python fi if test -z "$PYTHON"; then echo "No python found in the PATH. Please install Python and set PY_HOME." exit 1 fi # restore ordinary behaviour # unset IFS export PYTHONPATH=$APP_HOME # run it case $1 in 'zhishu' ) CLASS=yiis/data/neteasy_zhishu_loader.py "$PYTHON" $APP_HOME/$CLASS "$@" ;; 'stock' ) echo "开始抓取。。。" CLASS=yiis/data/neteasy_stock_loader.py "$PYTHON" $APP_HOME/$CLASS "$@" echo "数据抓取结束。。。" echo "数据导入到数据库。" CLASS=yiis/data/process_stock_data.py "$PYTHON" $APP_HOME/$CLASS db echo "导入完成。" ;; *) echo 'usage: `basename $0` {zhishu|stock}' esac