Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riyadhalnur/lambda-twitter-blog-hook
Automagically post to Twitter timeline about new blog post using Go on AWS Lambda.
https://github.com/riyadhalnur/lambda-twitter-blog-hook
aws-lambda git go golang twitter webhook
Last synced: 7 days ago
JSON representation
Automagically post to Twitter timeline about new blog post using Go on AWS Lambda.
- Host: GitHub
- URL: https://github.com/riyadhalnur/lambda-twitter-blog-hook
- Owner: riyadhalnur
- License: mit
- Created: 2018-02-10T11:21:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T02:17:42.000Z (over 1 year ago)
- Last Synced: 2024-10-17T02:39:44.651Z (22 days ago)
- Topics: aws-lambda, git, go, golang, twitter, webhook
- Language: Go
- Size: 35.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Lambda Twitter Blog Poster
=================
> Automagically post to Twitter timeline about new blog post using Go on AWS Lambda.**TL;DR** Events are generated using webhooks - Gitlab in this case because that's where I store my site. On specific commit events (the commits contain a [NEW POST] block), a Twitter status is pushed to my timeline.
### Developing
#### Requirements
- [Serverless](https://serverless.com/)
- [Go](https://golang.org/)#### Getting started
1. Create a `env.yml` file in the root of the project.
2. Declare the following variables and values in the file -
```yaml
secrets:
HOOK_SECRET: **
API_KEY: **
API_SECRET: **
ACCESS_TOKEN: **
ACCESS_SECRET: **
BASE_URL: **
```### Deploy
1. To deploy, use `sls deploy -v` **OR** `make deploy`.
2. Once deployed, copy the API Gateway URL printed on the console.### Create a webhook
*Only GitLab is supported at the moment*1. Navigate to the repo for which a webhook will be triggered.
2. From the panel on the left, go to `Settings > Integrations` to create a new webhook.
3. Paste the URL from the last section into the `URL` field and the secret from the `serverless.env.yml` file in to the `Secret Token` field.
4. Check `Push Events` under `Trigger`.
5. Click on `Add webhook` to save.### Triggering the function
1. To trigger a new post to Twitter on new post publishes, commit your new posts in the form -
```
[NEW POST]
The title of the post
permalink-of-the-post
```
2. Profit!### Contributing
Read the [CONTRIBUTING](CONTRIBUTING.md) guide for information.### License
Licensed under MIT. See [LICENSE](LICENSE) for more information.### Issues
Report a bug in [issues](https://github.com/riyadhalnur/lambda-twitter-blog-hook/issues).Made with love in Kuala Lumpur, Malaysia by [Riyadh Al Nur](https://verticalaxisbd.com)