From 43afbe498cf2f5aa47bee720b150d0b12a86ccab Mon Sep 17 00:00:00 2001 From: panqihua Date: Mon, 13 Jun 2022 14:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=85=E7=90=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=AF=AF=E5=88=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pixiv/config.json.example | 2 +- pixiv/pixiv.sh | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) 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