Skip to content

Commit 9b16a22

Browse files
committed
Update seo-check.js
1 parent 1639667 commit 9b16a22

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/seo-check/seo-check.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,26 @@ const openai = new OpenAI({
2121
// 4. Send to OpenAI
2222
(async () => {
2323
try {
24+
const prompt = `Please review the following markdown content, and recommend SEO improvements.
25+
The SEO improvements should be made in coordination with the following guidelines:
26+
- https://developers.google.com/search/docs/fundamentals/creating-helpful-content
27+
- https://developers.google.com/search/docs/crawling-indexing/url-structure
28+
29+
Please extract non-generic focus points from the content and suggest specific improvements.
30+
You can extract specific sections from the content, place it in markdown code block, and then below,
31+
make a markdown codeblock containing a new suggestion for the section.
32+
33+
:\n\n${content}`;
34+
2435
const chatCompletion = await openai.chat.completions.create({
2536
model: 'gpt-4',
2637
messages: [
2738
{ role: 'system', content: 'You are a helpful SEO and content writing assistant.' },
28-
{ role: 'user', content: `Please review and improve this Markdown article for SEO:\n\n${content}` }
39+
{ role: 'user', content: prompt }
2940
],
3041
});
3142

3243
const result = chatCompletion.choices[0].message.content;
33-
console.log('\n💬 Response from OpenAI:\n');
34-
console.log(result);
3544

3645
// Optional: write to file
3746
const outputPath = filePath.replace(/\.md$/, '.openai.md');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy