{"id":13862106,"url":"https://github.com/beltoforion/openai-ghostwriter","last_synced_at":"2025-12-30T00:28:33.003Z","repository":{"id":148181251,"uuid":"582792379","full_name":"beltoforion/openai-ghostwriter","owner":"beltoforion","description":"A python script for fully automatically generating web pages including images using OpenAI's GPT-3.","archived":false,"fork":false,"pushed_at":"2025-05-29T11:10:05.000Z","size":709,"stargazers_count":27,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-29T12:44:31.984Z","etag":null,"topics":["ai","ai-text","ai-writing","ghostwriting","gpt-3","openai","python3","text-generation"],"latest_commit_sha":null,"homepage":"https://beltoforion.de/en/gpt-ghostwriter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beltoforion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-27T22:05:39.000Z","updated_at":"2025-05-29T11:10:10.000Z","dependencies_parsed_at":"2025-05-29T12:27:35.848Z","dependency_job_id":"f679a5b6-c4ff-4291-b27e-d676c91a829f","html_url":"https://github.com/beltoforion/openai-ghostwriter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beltoforion/openai-ghostwriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beltoforion%2Fopenai-ghostwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beltoforion%2Fopenai-ghostwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beltoforion%2Fopenai-ghostwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beltoforion%2Fopenai-ghostwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beltoforion","download_url":"https://codeload.github.com/beltoforion/openai-ghostwriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beltoforion%2Fopenai-ghostwriter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265285659,"owners_count":23740571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-text","ai-writing","ghostwriting","gpt-3","openai","python3","text-generation"],"created_at":"2024-08-05T06:01:37.223Z","updated_at":"2025-12-30T00:28:32.961Z","avatar_url":"https://github.com/beltoforion.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"![title](https://github.com/user-attachments/assets/dae32013-6d97-446e-ba5a-a24710de9630)\n\n# The GPT-4 Ghostwriter\n\nA python script for fully automatically creating web articles with images about any user specified topic. The script uses OpenAI's GPT-4 as a content creator. it will first send a request to create a table of contents in a specified xml format and it will then iterate over the table of content and request GPT-4 to write a specific chapter and its subsections. For some chapters it will use GPT-4 to create a prompt that describes an image related to the article. This prompt is then submitted to Dall-E-3 for image generation. The result is formatted in HTML and inserted into a user specified web page template. \n\nContent generation works in any Language known to GPT-4 but i only tried german and english. Example results can be found here: \n\nArticle example:\n\n* [The History of Space Exploration](https://beltoforion.de/de/gpt-ghostwriter/article_history_of_space_exploration/index.php)  (Created by Version 2.0.0 in the writing style of a Carl Sagan)\n\n## Changes\n\nVersion 2.0.0 (2025-04-24):\n* Code updated to use OpenAI client class\n* Code updated to use GPT-4 and Dall-E-3\n* Created three separate classes for TOC creation, image creation and article creation\n\nVersion 1.0.2 (2023-01-09):\n* Added command line option to set writing style.\n* fixed a bug that was messing up the created HTML\n\nVersion 1.0.1 (2022-12-31):\n* Added placeholder for script version number\n* OpenAI prompts modified\n* added option for verbose mode\n* improved output quality with a hardcoded filter that will remove the first paragraph of subsections. This paragraph contained repetetive explanations about the article topic. \n\nVersion 1.0.0:\n* initial release\n\n## Usage\n\nIn order to use this script you must have an OpenAI API key that is exported in the environment variable OPENAP_API_KEY.\nTo execute the script type in the following command line:\n\n```python\npython ./ghostwriter.py -t \"The Rise of AI generated Content\" -tmpl ./template.html -o ai_content\n```\n\nThe command will create a HTML article about the topic \"The Rise of AI generated Content\". It will build and send the necessary API queries to OpenAI's servers and compile a web page complete with a couple of images. \n\n ## Command Line Options\n\n\u003cb\u003e-t\u003c/b\u003e\u003cbr/\u003e The topic to write about. Should be written in Quotation marks.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003e-tmpl\u003c/b\u003e\u003cbr/\u003e The template file used for output formatting. The layout of a template file is simple. It is a text file that needs to contain the two placeholders {TOPIC}, {CONTENT} and optionally {VERSION}. The {TOPIC} placeholder will be replaced with the article topic and the {CONTENT} placeholder will be replaced with the HTML formatted article. The {VERSION} placeholder will be replaced with the script version.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003e-o\u003c/b\u003e\u003cbr/\u003e The output folder. If the folder does not exist it will be created.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003e-v\u003c/b\u003e\u003cbr/\u003e Verbose mode. In this mode the prompts will be output to the console.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003e-s\u003c/b\u003e\u003cbr/\u003e Writing Style. Set the Writing style. i.e. \"National Geographic\", \"Carl Sagan\" or \"Drunken Pirate\"\n\u003cbr/\u003e\u003cbr/\u003e\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeltoforion%2Fopenai-ghostwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeltoforion%2Fopenai-ghostwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeltoforion%2Fopenai-ghostwriter/lists"}