{"id":22194124,"url":"https://github.com/filiprokita/article-to-html","last_synced_at":"2026-04-29T22:05:14.780Z","repository":{"id":262638350,"uuid":"887885991","full_name":"FilipRokita/article-to-html","owner":"FilipRokita","description":"A script that automatically converts a text article to an HTML document using the GPT-4o model.","archived":false,"fork":false,"pushed_at":"2025-03-04T12:31:08.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T13:18:49.758Z","etag":null,"topics":["ai","automation","conversion","gpt-4","html","openai","python","python3","script","web"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FilipRokita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-11-13T13:04:50.000Z","updated_at":"2025-03-04T12:31:11.000Z","dependencies_parsed_at":"2024-11-13T18:30:21.915Z","dependency_job_id":"d2dd84e1-b073-4b0e-aa82-bd18e2e546bb","html_url":"https://github.com/FilipRokita/article-to-html","commit_stats":null,"previous_names":["filiprokita/oxido-zadanie","filiprokita/article-to-html"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FilipRokita/article-to-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipRokita%2Farticle-to-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipRokita%2Farticle-to-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipRokita%2Farticle-to-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipRokita%2Farticle-to-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FilipRokita","download_url":"https://codeload.github.com/FilipRokita/article-to-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipRokita%2Farticle-to-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","automation","conversion","gpt-4","html","openai","python","python3","script","web"],"created_at":"2024-12-02T13:11:31.765Z","updated_at":"2026-04-29T22:05:14.761Z","avatar_url":"https://github.com/FilipRokita.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Article Converter to HTML\n\nThis Python script allows converting a text article into a structured HTML document using the GPT-4o model from OpenAI. The script generates HTML code based on the provided article text and saves it to a file.\n\n## Features\n\n- Load article text from a file\n- Generate structured HTML code\n- Save the generated HTML code to a file\n- Simple command-line interface\n\n## Requirements\n\n- Python 3.x+\n- OpenAI API Key (requires an OpenAI account)\n- A `.env` file containing the OpenAI API key\n- Installed `openai` and `python-dotenv` libraries\n\n## Installation\n\n1. Clone or download the repository to your machine.\n\n2. Install the required Python libraries using pip:\n\n   ```bash\n   pip3 install -r requirements.txt\n   ```\n\n3. Create a `.env` file in the same directory as the script, with the following content:\n\n   ```\n   OPENAI_API_KEY=your_openai_api_key\n   ```\n\n   Replace `your_openai_api_key` with your actual OpenAI API key.\n\n## Usage\n\n1. Place the article you want to convert to HTML in a text file named `article_text.txt`.\n2. Run the script:\n\n   ```bash\n   python3 main.py\n   ```\n\n3. The script will perform the following steps:\n   - Load the article from the specified file.\n   - Generate HTML code using OpenAI.\n   - Save the generated HTML code to a file named `article.html`.\n   - Display a message indicating successful generation and saving of the HTML.\n\n## Code Overview\n\n`main()`  \nThe main function that sets up the program, loads the article, generates HTML, and saves it to a file.\n\n`configure()`  \nConfigures the OpenAI client by loading the API key from the `.env` file using the `python-dotenv` library.\n\n`load_article(filename)`  \nLoads the article from the specified file.\n\n`generate_html_content(article_text)`  \nGenerates HTML from the article using the GPT-4o model. The HTML is structurally organized according to guidelines.\n\n`save_html_content(html_content, filename)`  \nSaves the generated HTML code to the specified file.\n\n## Author\n\nFilip Rokita  \n[www.filiprokita.com](https://www.filiprokita.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliprokita%2Farticle-to-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiliprokita%2Farticle-to-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliprokita%2Farticle-to-html/lists"}