{"id":41481565,"url":"https://github.com/intertwine/social-compliance-generator","last_synced_at":"2026-01-23T17:20:28.699Z","repository":{"id":243780018,"uuid":"810047187","full_name":"intertwine/social-compliance-generator","owner":"intertwine","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-06T11:22:36.000Z","size":309,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-08T22:17:10.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/intertwine.png","metadata":{"files":{"readme":"README-AUTH.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":"2024-06-04T00:17:59.000Z","updated_at":"2025-12-06T11:22:34.000Z","dependencies_parsed_at":"2025-11-27T23:02:52.784Z","dependency_job_id":null,"html_url":"https://github.com/intertwine/social-compliance-generator","commit_stats":null,"previous_names":["intertwine/social-compliance-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/intertwine/social-compliance-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intertwine%2Fsocial-compliance-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intertwine%2Fsocial-compliance-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intertwine%2Fsocial-compliance-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intertwine%2Fsocial-compliance-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intertwine","download_url":"https://codeload.github.com/intertwine/social-compliance-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intertwine%2Fsocial-compliance-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28696523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T15:57:05.722Z","status":"ssl_error","status_checked_at":"2026-01-23T15:56:27.656Z","response_time":59,"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":[],"created_at":"2026-01-23T17:20:28.203Z","updated_at":"2026-01-23T17:20:28.687Z","avatar_url":"https://github.com/intertwine.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generating API and Social Media Auth Tokens for Social Compliance Generator\n\nTo set up and run the project, you will need to generate authentication tokens for the following APIs and social media platforms and add them to your local `.env` file:\n\n## Social Media Platforms\n\n### X.com\n\nFollow the steps below to set up an automated bot account on X.com and obtain authentication tokens for posting to the platform.\n\n**Required OAuth Scopes:** `tweet.read`, `tweet.write`, `users.read`, `offline.access`, `media.write`\n\nThe `media.write` scope is required for video uploads. If you're getting 403 errors on media upload, re-authorize with all scopes.\n\n1. (Highly recommended) Create an automated bot account on X.com to comply with X's [Terms of Service](https://developer.x.com/en/more/developer-terms).\n\n   - Link your main X account to the bot account using Step 1 of the [X developer tutorial](https://developer.x.com/en/docs/tutorials/creating-a-twitter-bot-with-python--oauth-2-0--and-v2-of-the-twi).\n\n1. In your main X.com account, create a developer account, configure an X App and obtain consumer keys by [following this tutorial](https://developer.x.com/en/docs/tutorials/step-by-step-guide-to-making-your-first-request-to-the-twitter-api-v2)\n\n1. Generate authentication tokens using one of the methods below:\n\n#### Option A: xurl CLI (Recommended)\n\nUse the official [xurl CLI](https://github.com/xdevplatform/xurl) from the X Developer Platform - the simplest method.\n\n##### Prerequisites\n\nConfigure your X App's redirect URI in the X Developer Portal to: `http://localhost:8080/callback`\n\n##### Step 1: Install xurl\n\n```shell\ncurl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | sudo bash\n```\n\n##### Step 2: Run OAuth 2.0 Flow\n\n```shell\nexport CLIENT_ID=your_client_id\nexport CLIENT_SECRET=your_client_secret\nxurl auth oauth2\n```\n\nThis opens a browser for authorization and automatically handles the token exchange.\n\n##### Step 3: Retrieve Tokens\n\nTokens are stored in `~/.xurl`. You can verify authentication worked:\n\n```shell\nxurl /2/users/me\n```\n\nExtract the tokens from `~/.xurl` and add them to your `.env` file and GitHub secrets.\n\n##### Bonus: Test API Calls\n\nxurl can also be used to test X API endpoints directly:\n\n```shell\n# Get your user info\nxurl /2/users/me\n\n# Post a tweet\nxurl -X POST /2/tweets -d '{\"text\":\"Hello from xurl!\"}'\n```\n\n#### Option B: GitHub Actions Workflow\n\nUse the built-in GitHub Actions workflow to generate tokens without running a local server.\n\n##### GitHub Secrets Setup\n\nConfigure these GitHub secrets in your repository (Settings → Secrets and variables → Actions):\n\n- `X_API_CLIENT_ID` - Your X API app's client ID\n- `X_API_CLIENT_SECRET` - Your X API app's client secret\n\n##### Step 1: Generate Authorization URL\n\n1. Go to **Actions** → **X OAuth Token Generator**\n2. Click **Run workflow** and leave the `callback_url` input empty\n3. Run the workflow and view the output\n\nThe output will display:\n\n- An authorization URL to open in your browser\n- A `CODE_VERIFIER` value - **copy and save this!**\n\n##### Step 2: Authorize and Get Callback URL\n\n1. Open the authorization URL in your browser\n2. Log in and authorize the app with your X account\n3. You'll be redirected to `http://127.0.0.1:3000/callback?state=...\u0026code=...`\n4. The page won't load - that's expected! Copy the **entire URL** from your address bar\n\n##### Step 3: Exchange for Tokens\n\n1. Take the callback URL you copied and append the code verifier:\n\n   ```text\n   http://127.0.0.1:3000/callback?state=...\u0026code=...\u0026code_verifier=YOUR_CODE_VERIFIER_HERE\n   ```\n\n2. Run the **X OAuth Token Generator** workflow again\n3. Paste the full URL (with `\u0026code_verifier=...` appended) into the `callback_url` input\n4. The workflow will output your `X_API_ACCESS_TOKEN` and `X_API_REFRESH_TOKEN`\n\n##### Step 4: Save the Tokens\n\nAdd/update these GitHub secrets:\n\n- `X_API_ACCESS_TOKEN`\n- `X_API_REFRESH_TOKEN`\n\nFor local development, also add them to your `.env` file.\n\n#### Option C: Local xauth Server\n\nUse the xauth submodule to generate tokens via a local OAuth server.\n\n```shell\n# In the root directory of this repository:\n\u003e git submodule update --init --recursive\n\u003e cd xauth\n\u003e npm i\n\u003e npm update\n\u003e cp .example.env .env\n# ...configure .env with client keys from your X.com developer account...\n# note, change the PORT in .env to 5001 so as not to conflict with the port used by the trigger.dev server\n# then start the server:\n\u003e npm run start\n```\n\nOpen your browser to \u003chttp://localhost:5001/oauth2\u003e\n\n- Click on the \"Authorize\" button to authorize the app\n- Log in to the X.com account you want to use for posting\n- Accept the permissions requested\n- Copy the \"Access Token\" and \"Refresh Token\" from the response\n  - Paste them into the .env file in the root directory of the project (X_API_ACCESS_TOKEN and X_API_REFRESH_TOKEN)\n  - The \"Refresh Token\" is used to obtain a new \"Access Token\" when it expires.\n\nOnce you have the access token and refresh token, you can stop the xauth server. (Ctrl+C)\n\n_The xauth submodule is modified from: \u003chttps://github.com/alkihis/twitter-api-v2-user-oauth-flow-example.git\u003e_\n\n### Facebook\n\n[Placeholder - not implemented yet]\n\n### Instagram\n\n[Placeholder - not implemented yet]\n\n## APIs\n\nSee [README.md](README.md) for the complete list of API keys needed for v2.0:\n\n- **OpenRouter** - LLM access\n- **Tavily** - AI-powered web search\n- **Google Cloud / Vertex AI** - Gemini image generation\n- **OpenAI** - Sora 2 video generation\n- **Cloudflare** - KV storage for tokens, R2 for workflow storage (optional)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintertwine%2Fsocial-compliance-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintertwine%2Fsocial-compliance-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintertwine%2Fsocial-compliance-generator/lists"}