Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pnevares/haiku-tweets
Identify haiku on Twitter and post them
https://github.com/pnevares/haiku-tweets
bot haiku tweet twitter
Last synced: 16 days ago
JSON representation
Identify haiku on Twitter and post them
- Host: GitHub
- URL: https://github.com/pnevares/haiku-tweets
- Owner: pnevares
- License: mit
- Created: 2018-03-01T03:24:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:19:48.000Z (about 2 years ago)
- Last Synced: 2023-02-26T22:12:09.034Z (almost 2 years ago)
- Topics: bot, haiku, tweet, twitter
- Language: JavaScript
- Homepage:
- Size: 1.53 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# haiku-tweets
Identify haiku on Twitter and post them
[![Build Status](https://travis-ci.org/pnevares/haiku-tweets.svg?branch=master)](https://travis-ci.org/pnevares/haiku-tweets)
## Twitter setup:
1. Refer to `./config.json.template` to create your `./config.json`
1. Create a Twitter account for your bot, follow the accounts you're interested in
1. Create an app on Twitter to get your API keys
1. Save your API keys and account name in `./config.json`## AWS setup:
1. Create an S3 bucket for your bot (this is used to store your last seen tweetId)
1. Create access keys for your AWS account
1. Save your access keys and S3 bucket config in `./config.json`## Steps to deploy to AWS Lambda:
1. Run `npm run build` in the project root
1. Create a Lambda function, upload `dist.zip` from the previous step, and input `lambda.myHandler` as the handler
1. Set up a CloudWatch rule for your bot's update interval (ex: 10 minutes)## Deploy to your Lambda from the CLI
1. Run `npm run build` in the project root
1. [Install and configure the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)
1. From your project root:
```
aws lambda update-function-code \
--function-name YOUR_LAMBDA \
--zip-file fileb://./dist.zip
```## Common problems:
### My bot is retweeting its own tweets
Your account name in `./config.json` should be preventing this, check for typos.
### Replies sometimes include the parent user's username
A tweet's text will include the parent's username if the parent and child are different users.## Example accounts using this code:
* https://twitter.com/WaypointHaiku
* https://twitter.com/GiantbombHaiku
* https://twitter.com/McelroyHaiku
* https://twitter.com/PolygonHaiku