{"slug": "a-script-used-to-generate-wikipedia-style-pages-via-chatgpt", "title": "A script used to generate Wikipedia-style pages via ChatGPT", "summary": "A developer created a script called 'mypedia' that uses ChatGPT to generate short, balanced reference pages in the style of Wikipedia articles. The script takes a name as input, prompts ChatGPT to produce a neutral summary with links to authoritative sources, and saves the output as a Markdown file both locally and to an S3 bucket for public access.", "body_md": "| //mypedia -- build a short, balanced reference page about a name, using ChatGPT. | |\n| const name = args [0]; | |\n| if (name === undefined) { | |\n| console.log (\"Usage: belt mypedia.belt \\\"name\\\"\"); | |\n| } | |\n| else { | |\n| //first-cut prompt -- refine the wording here. | |\n| const prompt = \"Build a short, balanced reference page about \" + name + \". \" | |\n| + \"Follow the structure of a Wikipedia article but keep it brief -- an outline of the basic facts, not a long detailed treatment. \" | |\n| + \"Cover who or what it is, why it matters, and the essential history. \" | |\n| + \"Stay neutral; where there is controversy, note the main sides briefly rather than taking one. \" | |\n| + \"Include links to authoritative web sources so the reader can follow the original work. \" | |\n| + \"Return the page as Markdown, starting with a top-level heading for the name.\"; | |\n| const markdown = chatGpt.ask (prompt); | |\n| const hyphenated = string.replaceAll (name, \" \", \"-\"); | |\n| //local copy. | |\n| const filepath = config.user.prefs.publicfolder + \"mypedia/\" + hyphenated + \".md\"; | |\n| file.sureFilePath (filepath); | |\n| file.writeWholeFile (filepath, markdown); | |\n| console.log (\"Wrote \" + filepath); | |\n| //S3 copy at a calendar-structured, lowercase path, served by PagePark. | |\n| const now = new Date (); | |\n| const year = now.getFullYear (); | |\n| const month = (\"0\" + (now.getMonth () + 1)).slice (-2); | |\n| const day = (\"0\" + now.getDate ()).slice (-2); | |\n| const datepath = year + \"/\" + month + \"/\" + day; | |\n| const slug = hyphenated.toLowerCase () + \".md\"; | |\n| const s3path = \"/scripting/mypedia/\" + datepath + \"/\" + slug; | |\n| s3.newObject (s3path, markdown, \"text/markdown\", \"public-read\"); | |\n| console.log (\"https://library.scripting.com/\" + datepath + \"/\" + slug); | |\n| } |", "url": "https://wpnews.pro/news/a-script-used-to-generate-wikipedia-style-pages-via-chatgpt", "canonical_source": "https://gist.github.com/scripting/1897c81d0c61536228de5bdc0e7d7c9a", "published_at": "2026-06-12 14:40:21+00:00", "updated_at": "2026-06-22 03:39:37.036704+00:00", "lang": "en", "topics": ["large-language-models", "generative-ai", "developer-tools"], "entities": ["ChatGPT", "OpenAI", "S3", "PagePark", "Scripting.com"], "alternates": {"html": "https://wpnews.pro/news/a-script-used-to-generate-wikipedia-style-pages-via-chatgpt", "markdown": "https://wpnews.pro/news/a-script-used-to-generate-wikipedia-style-pages-via-chatgpt.md", "text": "https://wpnews.pro/news/a-script-used-to-generate-wikipedia-style-pages-via-chatgpt.txt", "jsonld": "https://wpnews.pro/news/a-script-used-to-generate-wikipedia-style-pages-via-chatgpt.jsonld"}}