
This library is an "AI NG Word Checker" system that uses Google Sheets as an interface to leverage AI (Google's Gemini or OpenAI's GPT) to automate content checking for websites and blog posts.
This page explains the library's purpose, use cases, and setup procedures.


The purpose of this library is to automate the quality management and compliance checking of published content at high speed and with high accuracy using AI, a task that would be incredibly time-consuming to do manually.
The system consists of two main functions:
This library is extremely effective in the following scenarios:
The setup procedure is as follows.
Step 1: Add the GAS Library
1KQUhXpCDcO86RYiOrBl6COCIvHnL7A9IoIYsMisY-OKm7aM7qbghjOkmAINGWordChecker (recommended) and click "Add."Step 2: Paste the Sample Code
Copy and paste the "Code.gs Sample Code" from the end of this article into your Code.gs file in the GAS editor. This code will create the custom menu in your spreadsheet.
Step 3: Prepare the "settings" Sheet
This library reads its configuration from a sheet named "settings" via the getLibraryConfig function (in the sample code).
settings".gemini-1.5-flash or gpt-4o).URLcheck).NGwordsetting).Final_NG_Word_List).Step 4: Run "Update Final NG Word List"
NGwordsetting).Final_NG_Word_List).Step 5: Run "Run NG Word Check"
URLcheck).done) will be written to Column C.Code.gs Sample Code(This is the code to paste into your Code.gs file in Step 2)
/**
* Adds a custom menu when the spreadsheet is opened.
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('AI Checker')
.addItem('Run NG Word Check', 'runNGWordCheck')
.addItem('Update Final NG Word List', 'runRelatedWordGeneration')
.addToUi();
}
/**
* Helper function to read settings from the 'Settings' sheet.
*/
function getLibraryConfig() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('settings');
if (!sheet) {
throw new Error('Cannot find the Settings sheet.');
}
// Read values from B1 to B6
const values = sheet.getRange('B1:B6').getValues();
return {
geminiApiKey: values[0][0],
openaiApiKey: values[1][0],
model: values[2][0],
urlSheetName: values[3][0],
ngSheetName: values[4][0],
finalNgWordSheetName: values[5][0]
};
}
/**
* Runs the NG word check function from the library.
*/
function runNGWordCheck() {
try {
const config = getLibraryConfig();
// Calls the library function using the Identifier (AINGWordChecker)
AINGWordChecker.checkArticlesForNGWords(config);
SpreadsheetApp.getUi().alert('NG Word Check complete.');
} catch (e) {
Logger.log(`Error: ${e.message}`);
SpreadsheetApp.getUi().alert(`Error: ${e.message}`);
}
}
/**
* Runs the related word generation and list update function from the library.
*/
function runRelatedWordGeneration() {
try {
const config = getLibraryConfig();
// Calls the library function using the Identifier (AINGWordChecker)
AINGWordChecker.generateRelatedNGWords(config);
SpreadsheetApp.getUi().alert('Final NG Word List update complete.');
} catch (e) {
Logger.log(`Error: ${e.message}`);
SpreadsheetApp.getUi().alert(`Error: ${e.message}`);
}
}No, it is not a standard feature. This is a third-party GAS (Google Apps Script) library. Also, it is not free. As explained in Step 3, you must set your own API key for an AI (either Gemini or OpenAI) in the "settings" sheet. You will incur costs (API usage fees) based on your AI usage.
No, it is different. According to the article's description, this library extracts the article's text, then sends that content and the "Final NG Word List" to an AI (Gemini or ChatGPT). It then asks the AI to judge "whether this article contains any NG words." This implies a check that can consider context, rather than just simple string matching.
Yes, that is correct. The URL check (Step 5) runs by referencing the "Final NG Word List" (the Final_NG_Word_List sheet) that was automatically generated by the AI in Step 4. Therefore, you must run "Update Final NG Word List" at least once to create this final list. If you ever change or add to your "Base NG Words" (in the NGwordsetting sheet), you must run the update again to ensure those changes are reflected in the scan.
We can customize this sample to match your specific business requirements.
Book Free ConsultationPut it on Trello!Need a fix for HubSpot, CMS, or GAS? Post it on Trello.
Development Requests Here