test api push

This commit is contained in:
Ghlerrix
2023-08-07 15:12:49 +08:00
parent ffcec4f3a5
commit b40b8af201
4 changed files with 8 additions and 14 deletions

View File

@@ -9,8 +9,8 @@ on:
# - cron: '0 23 * * *' # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
# on:
schedule:
- cron: '*/5 * * * *' # 每5分钟一次测试用
# schedule:
# - cron: '*/5 * * * *' # 每5分钟一次测试用
jobs:
bot:

View File

@@ -13,6 +13,6 @@ if __name__ == '__main__':
result = requests.get(url)
big = re.findall('<loc>(.*?)</loc>', result.content.decode('utf-8'), re.S)
for i in big:
print(i)
# op_xml_txt = open('xml.txt', 'a')
# op_xml_txt.write('%s\n' % i)
# print(i)
op_xml_txt = open('xml.txt', 'a')
op_xml_txt.write('%s\n' % i)

View File

@@ -3,14 +3,8 @@
# 确保脚本抛出遇到的错误
set -e
# 检查是否传入了正确的参数
if [ $# -lt 1 ]; then
echo "Please provide the your website as an argument."
exit 1
fi
# 百度链接推送
python baidupush.py $1
# curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?site=https://vuepress.ghlerrix.cn&token=oUldnU4HZvSTlh0e"
python baidupush.py 'www.ghlerrix.cn'
curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?site=https://www.ghlerrix.cn&token=oUldnU4HZvSTlh0e"
rm -rf urls.txt # 删除文件

View File

@@ -19,7 +19,7 @@
"post-build": "next-sitemap --config next-sitemap.config.js",
"export": "next build && next-sitemap --config next-sitemap.config.js && next export",
"bundle-report": "ANALYZE=true yarn build",
"baidupush": "bash baidupush.sh 'www.ghlerrix.cn'"
"baidupush": "bash baidupush.sh"
},
"dependencies": {
"@giscus/react": "^2.2.6",