-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp_seo_automator.js
More file actions
33 lines (28 loc) · 954 Bytes
/
tmp_seo_automator.js
File metadata and controls
33 lines (28 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require('fs');
const { execSync } = require('child_process');
const path = './app/lib/career-paths.ts';
const content = fs.readFileSync(path, 'utf8');
// Extract slugs natively
const urls = ['https://www.richardewing.io/glossary'];
const regex = /slug:\s*'([^']+)'/g;
let match;
while ((match = regex.exec(content)) !== null) {
urls.push('https://www.richardewing.io/careers/' + match[1]);
}
// 1. IndexNow Ping
console.log('Sending IndexNow Ping...');
try {
const cmd = `node ping-indexnow.js ${urls.join(' ')}`;
console.log(execSync(cmd).toString());
} catch (e) {
console.error('IndexNow Error:', e.message);
}
// 2. Google Search Console Ping
console.log('\\nSending Google Indexing Ping...');
try {
const cmd = `node ping-google.js ${urls.join(' ')}`;
console.log(execSync(cmd).toString());
} catch (e) {
console.error('Google Ping Error:', e.message);
}
console.log('\\nSEO Automation Sweep Complete.');