{"id":47110961,"url":"https://github.com/dchobarkar/social-x-automation","last_synced_at":"2026-03-12T17:43:14.543Z","repository":{"id":340956885,"uuid":"1168291026","full_name":"dchobarkar/social-x-automation","owner":"dchobarkar","description":"Automates engagement on X via X API with automated text generation.","archived":false,"fork":false,"pushed_at":"2026-02-27T09:36:24.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-27T14:59:19.875Z","etag":null,"topics":["automation","bot","comment-bot","nexjts","oauth","openai","x-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/dchobarkar.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T08:09:59.000Z","updated_at":"2026-02-27T09:36:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dchobarkar/social-x-automation","commit_stats":null,"previous_names":["dchobarkar/social-x-automation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dchobarkar/social-x-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchobarkar%2Fsocial-x-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchobarkar%2Fsocial-x-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchobarkar%2Fsocial-x-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchobarkar%2Fsocial-x-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchobarkar","download_url":"https://codeload.github.com/dchobarkar/social-x-automation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchobarkar%2Fsocial-x-automation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30435746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: 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":["automation","bot","comment-bot","nexjts","oauth","openai","x-api"],"created_at":"2026-03-12T17:43:13.925Z","updated_at":"2026-03-12T17:43:14.506Z","avatar_url":"https://github.com/dchobarkar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social X Automation\n\nAutomates commenting on posts using the X (Twitter) API and OpenAI.\n\nThis is a personal automation tool built to reduce repetitive manual\nengagement. It runs locally and allows generating AI-powered replies and\nposting them directly via the X API using OAuth 2.0 Authorization Code\nFlow with PKCE.\n\n---\n\n## 🚀 What This Project Does\n\n- Authenticates with X using OAuth 2.0 (Authorization Code Flow +\n  PKCE)\n- Stores access and refresh tokens securely (local JSON storage)\n- Generates contextual replies using OpenAI\n- Posts replies via X API v2\n- Handles token refresh automatically\n- Provides a minimal dashboard to control the full flow (shows “Connected to X” when logged in)\n\nThis project is intended for personal use only.\n\n---\n\n## 🏗 Tech Stack\n\n- Next.js (App Router)\n- X API v2\n- OAuth 2.0 with PKCE\n- OpenAI API\n- Local JSON token storage\n\nNo separate backend server. Everything runs inside Next.js API routes.\n\n---\n\n## 📦 Installation\n\nClone the repository:\n\n    git clone https://github.com/dchobarkar/social-x-automation.git\n    cd social-x-automation\n\nInstall dependencies:\n\n    pnpm install\n\n---\n\n## 🔐 Environment Variables\n\nCreate a `.env.local` file in the root:\n\n    X_CLIENT_ID=YOUR_X_CLIENT_ID\n    X_CLIENT_SECRET=YOUR_X_CLIENT_SECRET\n    X_REDIRECT_URI=http://127.0.0.1:3000/api/auth/x/callback\n    OPENAI_API_KEY=YOUR_OPENAI_KEY\n    APP_BASE_URL=http://127.0.0.1:3000\n    STATE_SECRET=random_long_string_here\n\n**Important:** Use `127.0.0.1` instead of `localhost` for `X_REDIRECT_URI` and `APP_BASE_URL`.  \nX’s OAuth does not accept `localhost` as a callback URL and will return 400 if you use it.\n\nNever commit `.env.local` to GitHub.\n\n---\n\n## ▶ Running the Project\n\nStart the development server:\n\n    pnpm run dev\n\nVisit:\n\n    http://localhost:3000/dashboard\n\n---\n\n## 🧪 Usage Flow\n\n1. Click Connect X Account\n2. Approve OAuth permissions\n3. Get tweets either by **search** (keyword query) or **load my home feed** (same as your X home/feed, with optional filters)\n4. Generate AI reply variants (humorous / insightful)\n5. Review, edit if needed, and post reply\n\nEverything runs locally.\n\n---\n\n## 🛡 Security Notes\n\n- Access tokens are never exposed to the frontend\n- All X API calls are server-side\n- Refresh tokens are handled automatically\n- For production use, replace JSON storage with a secure database\n\n---\n\n## 📌 Current Scope\n\nThis project currently focuses on:\n\n- Local execution\n- Manual trigger commenting (search by keyword or load home feed)\n- Optional filters: time range, exclude replies/retweets, max reply count, min author followers\n- AI-assisted reply generation (humorous / insightful)\n- Review and post replies\n\nFuture enhancements may include: auto scanning posts, scheduling replies, multi-account support, advanced prompt customization.\n\n---\n\n## ⚠ Disclaimer\n\nThis tool is intended for personal automation.\\\nYou are responsible for complying with X's platform policies and rate\nlimits.\n\n---\n\n## 📜 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchobarkar%2Fsocial-x-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchobarkar%2Fsocial-x-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchobarkar%2Fsocial-x-automation/lists"}