Skip to content

Commit ff90a04

Browse files
committed
<Before Update Posts> auto backup on 2024-08-24T21:04:57.936Z
1 parent 2074f68 commit ff90a04

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

source/robots.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
Sitemap: https://activate-lock.techidaily.com/sitemap_index.xml
2-
User-agent: Googlebot
3-
Disallow:
42

5-
User-agent: Googlebot-image
6-
Disallow:
3+
User-agent: *
4+
Allow: /
5+
6+
7+
8+
79

810
User-agent: *
9-
Disallow: /scripts
10-
Disallow: /public
11+
Disallow: /scripts/
12+
Disallow: /public/
1113
Disallow: /css/
1214
Disallow: /images/
1315
Disallow: /content/

submit.bing.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ function range(start, end) {
2020

2121
// Step1: 从sitemap.txt, sitemap1.txt, sitemap2.txt ...中获取url列表
2222
const allUrls = [];
23-
const sitemapFiles = [
24-
'sitemap.txt',
25-
...range(1, 500).map(i => `sitemap${i}.txt`)
26-
];
27-
for (const file of sitemapFiles) {
28-
if (fs.existsSync(path.join(__dirname, '.deploy_git', file))) {
29-
const sitemap = fs.readFileSync(path.join(__dirname, '.deploy_git', file), 'utf-8');
30-
const urls = sitemap.split('\n').filter(Boolean).map(url => url.trim());
31-
allUrls.push(...urls);
32-
}
23+
const verifiedMapJSONFile = path.join(__dirname, '.verified-url2title-map.json');
24+
if (fs.existsSync(verifiedMapJSONFile)) {
25+
try {
26+
const content = fs.readFileSync(verifiedMapJSONFile, 'utf-8').toString();
27+
const obj = JSON.parse(content);
28+
Object.keys(obj).forEach(v => allUrls.push(v));
29+
} catch (e) {}
3330
}
3431

3532
console.log('All urls count:%d', allUrls.length);
@@ -117,7 +114,8 @@ function sendSubmit(engine, urls = []) {
117114
async function processQueue(engine, urlGroupsQueue) {
118115
for (const urls of urlGroupsQueue) {
119116
sendSubmit(engine, urls)
120-
await sleep();
117+
await sleep(30*1000);
118+
process.exit();
121119
}
122120
}
123121

0 commit comments

Comments
 (0)