https://github.com/hugomd/fake-hugo
Load my tweets into Redis, create a Markov chain, and generate sentences 🤖
https://github.com/hugomd/fake-hugo
bot markov twitter
Last synced: over 1 year ago
JSON representation
Load my tweets into Redis, create a Markov chain, and generate sentences 🤖
- Host: GitHub
- URL: https://github.com/hugomd/fake-hugo
- Owner: hugomd
- Created: 2017-12-10T00:31:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T22:23:11.000Z (over 8 years ago)
- Last Synced: 2025-01-20T14:37:43.650Z (over 1 year ago)
- Topics: bot, markov, twitter
- Language: JavaScript
- Size: 10.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fake-hugo 🤖
The code for [@notrealhugo](https://twitter.com/notrealhugo).
Uses my ([@hugojmd](https://twitter.com/hugojmd)) tweets as input into Redis, creating a key-value relationship as follows with two words as the key and one word as the value.
For example, the sentence `The quick brown fox jumps over the lazy dog` gets ingested as:
```
The quick -> brown
quick brown -> fox
brown fox -> jumps
fox jumps -> over
jumps over -> the
over the -> lazy
the lazy -> dog
```
## Install
```javascript
npm i
```
## Usage
1. Set your environment variables:
1. Twitter (create an app [here](https://apps.twitter.com/)):
1. `CONSUMER_KEY`
2. `CONSUMER_SECRET`
3. `ACCESS_TOKEN`
4. `ACCESS_TOKEN_SECRET`
2. Redis: `REDIS_URL`
3. The interval you want your bot to tweet at, `INTERVAL` (in minutes)
2. Download [your Twitter archive](https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive).
3. Move it to `./tweets.csv`.
4. Run `npm start` will ingest your tweets into Redis, and start the bot. The first tweet is after `INTERVAL` minutes.
## To do
* [ ] Stream tweets from Twitter, via username, and ingest them into Redis.
* [ ] Weight the likelihood of a value being chosen by how frequently it is used.