Skip to content

Commit

Permalink
fix: baidu submit url
Browse files Browse the repository at this point in the history
  • Loading branch information
3Alan committed Nov 9, 2022
1 parent 03cf69a commit 7a14337
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/baidu.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search-engines-urls-push",
"version": "0.2.1",
"version": "0.2.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 7a14337

Please sign in to comment.