{"id":50888775,"url":"https://github.com/kv5h/wp-auto-upload","last_synced_at":"2026-06-15T19:31:16.742Z","repository":{"id":322223248,"uuid":"1088270379","full_name":"kv5h/wp-auto-upload","owner":"kv5h","description":"Automatically upload AI-generated WordPress articles based on  prompts posted on Telegram Group","archived":false,"fork":false,"pushed_at":"2025-11-03T08:20:51.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-03T10:13:10.869Z","etag":null,"topics":["deepseek","telegram","wordpress"],"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/kv5h.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":"2025-11-02T16:42:36.000Z","updated_at":"2025-11-03T08:20:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kv5h/wp-auto-upload","commit_stats":null,"previous_names":["kv5h/wp-auto-upload"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kv5h/wp-auto-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kv5h%2Fwp-auto-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kv5h%2Fwp-auto-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kv5h%2Fwp-auto-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kv5h%2Fwp-auto-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kv5h","download_url":"https://codeload.github.com/kv5h/wp-auto-upload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kv5h%2Fwp-auto-upload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34377872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["deepseek","telegram","wordpress"],"created_at":"2026-06-15T19:31:13.709Z","updated_at":"2026-06-15T19:31:16.737Z","avatar_url":"https://github.com/kv5h.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-auto-upload\n\nAWS Lambda function that polls Telegram groups on a schedule, rewrites prompts with DeepSeek, and publishes the generated article to WordPress (then deletes the original messages).\n\n## Workflow\n\n### User's post based\n\n1. User post prompts to a Telegram group (Manually)\n1. Run any cloud server by schedule\n1. @ NodeJS application\n   1. Get new posts on Telegram group\n      1. For each post\n         1. Generate a blog content with AI LLM\n         1. Create a blog content via WordPress API\n         1. Delete original post\n\n### [TODO] Cron based\n\n1. Run a cloud server by schedule\n1. @ NodeJS application\n   1. Search trending keywords from Google\n   1. Generate a blog content with AI LLM\n   1. Create a blog content via WordPress API 2.\n\n## How it works\n\n- An EventBridge schedule (or another trigger) invokes the Lambda at the interval you choose.\n- The Lambda pulls pending updates from Telegram via the `getUpdates` Bot API method.\n- Each prompt is sent to DeepSeek to generate a blog post, which is then published through the WordPress REST API.\n- After a successful publish, the originating Telegram message is deleted so it is not processed again.\n\n## Environment variables\n\n| Name                             | Required | Description                                                                |\n| -------------------------------- | -------- | -------------------------------------------------------------------------- |\n| `DEEPSEEK_API_KEY`               | ✅       | Secret key for the DeepSeek API.                                           |\n| `DEEPSEEK_MODEL`                 | ⛔️      | Chat model name. Defaults to `deepseek-chat`.                              |\n| `DEEPSEEK_SYSTEM_PROMPT`         | ⛔️      | System prompt for the assistant. Default asks for a publishable blog post. |\n| `TELEGRAM_BOT_TOKEN`             | ✅       | Bot token obtained from BotFather.                                         |\n| `TELEGRAM_CHAT_ID`               | ✅       | Numeric chat ID of the target group (e.g. `-1001234567890`).               |\n| `TELEGRAM_FETCH_LIMIT`           | ⛔️      | Max updates to fetch per run (1-100). Defaults to `50`.                    |\n| `WORDPRESS_BASE_URL`             | ✅       | WordPress site root, e.g. `https://example.com`.                           |\n| `WORDPRESS_USERNAME`             | ✅       | WordPress username that owns an Application Password.                      |\n| `WORDPRESS_APPLICATION_PASSWORD` | ✅       | WordPress Application Password used for Basic Auth.                        |\n| `WORDPRESS_POST_STATUS`          | ⛔️      | Status for new posts (e.g. `draft`, `publish`). Defaults to `draft`.       |\n\nAll secrets must be supplied through Lambda environment variables. Nothing is stored in the code.\n\n## Local development\n\n1. Install dependencies once: `npm install`\n2. Compile TypeScript: `npm run build`\n3. (Optional) Run the handler locally (will contact Telegram/WordPress directly, so set the environment variables first):\n\n   ```bash\n   node -e \"const { handler } = require('./dist/handler'); (async () =\u003e { await handler(); })();\"\n   ```\n\n## Local emulation with Docker\n\nThis project includes a `Dockerfile` based on the official AWS Lambda Node.js image. It lets you run the Lambda locally with the same runtime the cloud service uses.\n\n1. Build the image: `docker build -t wp-auto-upload .`\n2. Run the container while supplying the environment variables (replace values as needed):\n\n   ```bash\n   docker run --rm -p 9000:8080 \\\n     --env-file ./.env \\\n     wp-auto-upload\n   ```\n\n3. Trigger the local Lambda endpoint:\n\n   ```bash\n   curl -X POST \\\n     http://localhost:9000/2015-03-31/functions/function/invocations \\\n     -d '{}'\n   ```\n\n   While the container runs it will pull live updates from Telegram, publish to WordPress, and delete processed messages. `events/sample-telegram.json` illustrates a typical Telegram [Update](https://core.telegram.org/bots/api#update); adjust it if you need to simulate incoming messages when\n   stubbing the Bot API.\n\n## Telegram group setup\n\n1. **Create a Telegram bot**\n   - Talk to [@BotFather](https://t.me/BotFather) and create a new bot.\n   - Copy the API token it returns and set it as `TELEGRAM_BOT_TOKEN`.\n2. **Add the bot to the target group**\n   - Invite the bot account to the Telegram group you want to automate.\n   - Promote the bot to admin (required to delete processed messages) and ensure it has rights to see and remove messages.\n3. **Obtain the group chat ID**\n   - Temporarily enable [Bot API mode with privacy disabled](https://core.telegram.org/bots/features#privacy-mode) or use a helper bot (e.g. [@RawDataBot](https://t.me/RawDataBot)) to read the `chat.id` value when a message is posted in the group.\n   - The ID is usually negative for supergroups (e.g. `-1001234567890`). Set this value as `TELEGRAM_CHAT_ID`.\n4. **Reset webhook (optional but recommended)**\n   - Because this project uses polling via `getUpdates`, ensure no webhook is configured by calling:\n     ```bash\n     curl \"https://api.telegram.org/bot\u003cTELEGRAM_BOT_TOKEN\u003e/setWebhook?url=\"\n     ```\n\n## Error handling\n\n- Updates without text content or from other chats are skipped and acknowledged so they are not retried.\n- Failures during DeepSeek, WordPress, or Telegram deletion leave the update unacknowledged, ensuring it will be retried on the next scheduled run (check CloudWatch logs for details).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkv5h%2Fwp-auto-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkv5h%2Fwp-auto-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkv5h%2Fwp-auto-upload/lists"}