From 7a14337a975168978e7b657693f1c8b1a1830115 Mon Sep 17 00:00:00 2001 From: 3Alan <1540703192@qq.com> Date: Thu, 10 Nov 2022 00:30:29 +0800 Subject: [PATCH] fix: baidu submit url --- api/baidu.js | 4 ++-- index.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/baidu.js b/api/baidu.js index cfa636d..f5affb7 100644 --- a/api/baidu.js +++ b/api/baidu.js @@ -1,10 +1,10 @@ const request = require('request-promise'); -module.exports = async (urlList, token) => { +module.exports = async (site, urlList, token) => { try { const data = urlList.join('\n'); const res = await request({ - url: `http://data.zz.baidu.com/urls?site=https://www.alanwang.site&token=${token}`, + url: `http://data.zz.baidu.com/urls?site=${site}&token=${token}`, method: 'POST', headers: { 'Content-Type': 'text/plain' diff --git a/index.js b/index.js index ef713f5..960b5de 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ try { .urlset.url.map(item => item.loc['_text']); const submitUrlList = count ? urlList.slice(0, count) : urlList; - baiduToken && submitBaidu(submitUrlList, baiduToken); + baiduToken && submitBaidu(site, submitUrlList, baiduToken); bingToken && submitBing(site, submitUrlList, bingToken); googleClientEmail && googlePrivateKey && diff --git a/package.json b/package.json index 7bc7bb9..53aead4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search-engines-urls-push", - "version": "0.2.1", + "version": "0.2.2", "description": "", "main": "index.js", "scripts": {