Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bertrandom/costanzabot
Bot generated from a markov chain of everything George Costanza says in Seinfeld
https://github.com/bertrandom/costanzabot
Last synced: 23 days ago
JSON representation
Bot generated from a markov chain of everything George Costanza says in Seinfeld
- Host: GitHub
- URL: https://github.com/bertrandom/costanzabot
- Owner: bertrandom
- Created: 2014-05-09T07:09:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-09T07:36:33.000Z (over 10 years ago)
- Last Synced: 2023-04-17T14:00:28.477Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 676 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# costanzabot
Bot generated from a markov chain of everything George Costanza says in Seinfeld
## Usage
`./test.rb` will spit out an example tweet.
## How this particular sausage was made
or "instructions for Future Bert if he wants to do this again".
This was mostly just an excuse to play with [twitter_ebooks](https://github.com/mispy/twitter_ebooks).
First, start with [seinfeld-scripts](https://github.com/colinpollock/seinfeld-scripts).
Next, patch it with this [fix](https://github.com/cschep/seinfeld-scripts/blob/d34dd1deac1b71c760f59bf810494b51e5b87042/download.sh).
```
mkdir scripts
./download.sh scripts
```Edit `scripts/01.shtml` and change `pc: 101, season 1, episode 1 (Pilot)
` to `pc: 101, season 1, episode 0 (Pilot)
`.```
./run.sh
```This will create an sqlite database called `seinfeld.db`.
Extract everything that George says into a text file:
```
sqlite3 seinfeld.db "SELECT sentence.utterance_id, sentence.text from sentence, utterance WHERE utterance.speaker = 'GEORGE' AND sentence.utterance_id = utterance.id;" > export.txt
```Move export.txt to the `seed` directory of this repo.
Join the utterances into single lines of text with the parsing script:
`./parse.rb > costanza.txt`
Create a skeleton for the bot.
`ebooks new costanzabot`
Move `costanza.txt` into the `corpus` directory.
Consume the lines into a Markov model:
```
ebooks consume corpus/costanza.txt
```