diff --git a/pixiv/config.json.example b/pixiv/config.json.example index f2bb772..b1b29a1 100644 --- a/pixiv/config.json.example +++ b/pixiv/config.json.example @@ -16,7 +16,7 @@ "error_file":"error.jpeg" }, "convertio":{ - "apikey":"https://developers.convertio.co/zh/ 申请的API密钥", + "apikey":"https://developers.convertio.co/zh/ 申请的API密钥" }, "Cronitor":{ "API_KEY":"https://cronitor.io/ 申请的Key", diff --git a/pixiv/pixiv.sh b/pixiv/pixiv.sh index b3c0135..e693171 100644 --- a/pixiv/pixiv.sh +++ b/pixiv/pixiv.sh @@ -43,8 +43,16 @@ convertio_apikey=`cat $config_file | jq -r .convertio.apikey` CronitorKey=`cat $config_file | jq -r .Cronitor.API_KEY` CronitorJobName=`cat $config_file | jq -r .Cronitor.JOB_NAME` + + +basePath=`cat $config_file|jq -r .basePath` +if [ ! -f $basePath ] +then + mkdir -p $basePath +fi # ================================================ +cd $basePath if [ ! -f $db_file ] then touch $db_file @@ -168,12 +176,7 @@ function Request(){ done } -basePath=`cat $config_file|jq -r .basePath` -if [ ! -f $basePath ] -then - mkdir -p $basePath -fi -cd $basePath + telegramToken=`cat $config_file | jq -r .telegramToken` baseApi="https://api.telegram.org/bot$telegramToken" @@ -389,5 +392,5 @@ done next_expected_at=`curl -v https://cronitor.io/api/monitors/$CronitorJobName -u $CronitorKey:''|jq .next_expected_at` Request "curl -v -d chat_id=$chat_id -d text=\"以上就是$today日榜前${length}名作品,本次推送完毕,下次推送时间预计是`date -d @$next_expected_at '+%Y-%m-%d %H:%M:%S'`,如有问题请联系管理员。 #date$_today #日期$_today \" $baseApi/sendMessage" -find -type f -mtime +7 -name "*.webp" -o -name "*.html" -o -name "*.info" -o -name "*.json" -not -name $config_file|xargs rm -f +find -type f -mtime +7 -name "*.webp" -o -name "*.html" -o -name "*.info" -o -name "*.json" -not -name `basename $config_file`|xargs rm -f DeleteMultipleObjects \ No newline at end of file