项目作者: hugomd

项目描述 :
Load my tweets into Redis, create a Markov chain, and generate sentences 🤖
高级语言: JavaScript
项目地址: git://github.com/hugomd/fake-hugo.git
创建时间: 2017-12-10T00:31:38Z
项目社区:https://github.com/hugomd/fake-hugo

开源协议:

下载


fake-hugo 🤖

The code for @notrealhugo.

Uses my (@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:

  1. The quick -> brown
  2. quick brown -> fox
  3. brown fox -> jumps
  4. fox jumps -> over
  5. jumps over -> the
  6. over the -> lazy
  7. the lazy -> dog

Install

  1. npm i

Usage

  1. Set your environment variables:
    1. Twitter (create an app here):
      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.
  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.