{"id":15164712,"url":"https://github.com/arnavk-09/automated-controversial-x-posts","last_synced_at":"2025-09-30T20:31:35.578Z","repository":{"id":247412156,"uuid":"821506610","full_name":"ArnavK-09/automated-controversial-x-posts","owner":"ArnavK-09","description":"🐦 Automated X bot to post controversial tweets...","archived":true,"fork":false,"pushed_at":"2024-07-13T07:54:13.000Z","size":491,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-12T03:47:11.328Z","etag":null,"topics":["automation","bot","github-actions","llama","openai","prompt","twitter","x"],"latest_commit_sha":null,"homepage":"https://x.com/on_meta","language":"JavaScript","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/ArnavK-09.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}},"created_at":"2024-06-28T17:41:01.000Z","updated_at":"2025-01-07T11:27:32.000Z","dependencies_parsed_at":"2024-07-08T17:02:43.068Z","dependency_job_id":"6f790c9a-1786-4479-9b52-c1186b22a449","html_url":"https://github.com/ArnavK-09/automated-controversial-x-posts","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"b0ca51768c3a5abef04d293c4bde9cdab62b5e98"},"previous_names":["arnavk-09/automated-controversial-x-posts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavK-09%2Fautomated-controversial-x-posts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavK-09%2Fautomated-controversial-x-posts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavK-09%2Fautomated-controversial-x-posts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavK-09%2Fautomated-controversial-x-posts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArnavK-09","download_url":"https://codeload.github.com/ArnavK-09/automated-controversial-x-posts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234774940,"owners_count":18884527,"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":["automation","bot","github-actions","llama","openai","prompt","twitter","x"],"created_at":"2024-09-27T04:00:23.585Z","updated_at":"2025-09-30T20:31:30.281Z","avatar_url":"https://github.com/ArnavK-09.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eControversial Tweeter 🐦\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg alt=\"Demo\" src=\"assets/demo.jpeg\"\u003e\n\u003c/p\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e Welcome to Controversial Tweeter, an automated script that leverages AI language models to generate and post content on Twitter every 2 days. This project demonstrates how to integrate OpenAI's language model (LLAMA3 via MindsDB endpoint) with the Twitter API using JavaScript.\n\n\u003e [!TIP]\n\u003e\n\u003e #### 🙋‍♀️ How It Works\n\u003e\n\u003e The script uses OpenAI's SDK to communicate with MindsDB's endpoint, where the LLAMA3 model resides. It fetches generated content and interacts with the Twitter REST API using `fetch` to post tweets at regular intervals.\n\n---\n\n## 🥪 Tech Stack\n\n- **JavaScript** (Node.js)\n- **OpenAI** SDK for LLAMA3 integration powered by **Minds DB**\n- Fetch API for **Twitter API** interaction\n\n## 🍗 Initializing\n\n\u003e To run the script, you need to set up two environment variables either in a **[`.env`](.env.example)** file or as GitHub secrets:\n\n```dotenv\n# YOUR AI MODEL / MINDSDB ENDPOINT API KEY\nAI_API_KEY=\"\u003cobtained from MDB.AI dashboard\u003e\"\n\n# YOUR X OAUTH ENCRYPTED HEADER\nOAUTH_HEADER=\"\u003cfollow steps below to obtain\u003e\"\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/github_secrets.jpeg\" alt=\"GitHub secrets\" /\u003e\n\u003c/p\u003e\n\n\n\n### 🍎 Obtaining Environment Variables\n\n##### 1. **API Key from MindsDB:**\n\n- Create a free account at **[MindsDB](https://mdb.ai/)**\n\n- Obtain your API key from the dashboard.\n\n#### 2. **OAuth Header for Twitter API:**\n\n| **Step 1:-** Go To **[`X Postman Workspace`](https://www.postman.com/xapidevelopers/workspace/twitter-s-public-workspace/request/9956214-5bd6ebb1-9d79-4456-a9a6-22ead4a41625)** |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ![Step1](assets/step_1.jpg)                                                                                                                                                      |\n\n| **Step 2:-** After forking workspace, open your fork and go to `Manage Tweets -\u003e Create a Tweet` |\n| ------------------------------------------------------------------------------------------------ |\n| ![Step2](assets/step_2.jpg)                                                                      |\n\n| **Step 3:-** Head to `Authorization` Tab and fill up neccessary keys and secrets that you would get from X Developer Portal |\n| --------------------------------------------------------------------------------------------------------------------------- |\n| ![Step3](assets/step_3.jpg)                                                                                                 |\n\n| **Step 4:-** Go to `Headers` Tab, copy `Authorization` header value (ensure you can view Hidden Headers) |\n| -------------------------------------------------------------------------------------------------------- |\n| ![Step4](assets/step_4.jpg)                                                                              |\n\n---\n\n## 🍕 Contributing\n\n\u003e **Your contributions are welcome! Here’s how you can contribute:**\n\n1. **Star the Repository:** ⭐️\n   Show your support by starring the repo.\n\n2. **Raise Pull Requests (PRs):**\n   - Fork the repository.\n   - Make your changes in a separate branch.\n   - Open a pull request with a detailed description of your changes.\n\n---\n\n\u003e [!CAUTION]\n\u003e\n\u003e This repository is purely for entertainment purposes. It does not promote controversial or racial thoughts. The use of AI language models and the content generated are intended for fun and educational demonstrations only.\n\n---\n\n\u003cp align=\"center\"\u003e \u003cstrong\u003e 🌟 Give this repo a star 🌟 \u003c/strong\u003e \u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnavk-09%2Fautomated-controversial-x-posts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnavk-09%2Fautomated-controversial-x-posts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnavk-09%2Fautomated-controversial-x-posts/lists"}