{"id":17601049,"url":"https://github.com/harshitrv/tweet-lambda","last_synced_at":"2026-02-14T04:04:34.818Z","repository":{"id":258376195,"uuid":"873815145","full_name":"HarshitRV/tweet-lambda","owner":"HarshitRV","description":"a tweet lambda to post tweets on twitter using llm","archived":false,"fork":false,"pushed_at":"2024-10-16T19:11:09.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T05:33:46.072Z","etag":null,"topics":["aws","aws-lambda","lambda","lambda-functions","serverless"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/HarshitRV.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-10-16T19:07:56.000Z","updated_at":"2024-10-16T19:11:12.000Z","dependencies_parsed_at":"2024-10-23T05:09:28.457Z","dependency_job_id":null,"html_url":"https://github.com/HarshitRV/tweet-lambda","commit_stats":null,"previous_names":["harshitrv/tweet-lambda"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshitRV%2Ftweet-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshitRV%2Ftweet-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshitRV%2Ftweet-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshitRV%2Ftweet-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarshitRV","download_url":"https://codeload.github.com/HarshitRV/tweet-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248728629,"owners_count":21152258,"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":["aws","aws-lambda","lambda","lambda-functions","serverless"],"created_at":"2024-10-22T12:08:18.095Z","updated_at":"2026-02-14T04:04:34.772Z","avatar_url":"https://github.com/HarshitRV.png","language":"TypeScript","readme":"# Tweet Lambda\n\nThis AWS Lambda function generates and posts tweets using the `ai-tweet-gen` library and AWS Secrets Manager for secure storage of API keys.\n\n## Project Structure\n\n```sh\n.\n├── src\n│   ├── handlers\n│   │   └── tweet-lambda.ts\n├── .gitignore\n├── package.json\n├── README.md\n├── serverless.yml\n├── yarn.lock\n```\n\n## Prerequisites\n\n- [Node.js 20.x](https://nodejs.org/en/download/package-manager)\n- [AWS CLI](https://aws.amazon.com/cli/) configured with appropriate permissions\n- [Serverless Framework](https://www.serverless.com/)\n\n## Setup\n\n1. **Install Dependencies**\n\n   ```sh\n    yarn install\n   ```\n\n2. **Configure AWS Secrets Manager**\n\n   Create a new secret with the following key-value pairs:\n\n   - `TWITTER_APP_KEY`\n   - `TWITTER_APP_SECRET`\n   - `TWITTER_ACCESS_TOKEN`\n   - `TWITTER_ACCESS_SECRET`\n\n3. **Configure Serverless Framework**\n\nUpdate the `provider` section in `serverless.yml` with your AWS account ID and region.\n\n```yml\n    org: \u003cyour-serverless-org-name\u003e\n    app: \u003cyour-serverless-app-name\u003e\n    service: \u003cyour-lambda-name\u003e\n\n    provider:\n      name: aws\n      runtime: nodejs20.x\n      stage: dev\n      region: ap-south-1\n\n    iam:\n      role:\n        statements:\n          - Effect: Allow\n            Action:\n              - secretsmanager:GetSecretValue\n            Resource:\n              - \u003cYOUR_SECRET_MANAGER_ARN\u003e\n    functions:\n      hello:\n        handler: src/handlers/tweet-lambda.tweetHandler\n        events:\n          - http:\n              path: tweet\n              method: get\n```\n\n## Deployment\n\n```sh\nserverless deploy\n```\n\n## Usage\n\nThe Lambda function is triggered via API Gateway. It generates a tweet using the `generatePostGemini` function and posts it to Twitter using the `postToX` function.\n\n### Example Request\n\n```sh\ncurl -X GET https://\u003capi-id\u003e.execute-api.\u003cregion\u003e.amazonaws.com/dev/tweet\n```\n\n### Example Response\n\n```json\n{\n  \"statusCode\": 200,\n  \"body\": \"{\\\"message\\\":\\\"Tweet posted successfully!\\\"}\"\n}\n```\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshitrv%2Ftweet-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshitrv%2Ftweet-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshitrv%2Ftweet-lambda/lists"}