Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asmeurer/markov
Generate text from hangouts chat with markov chains
https://github.com/asmeurer/markov
Last synced: 6 days ago
JSON representation
Generate text from hangouts chat with markov chains
- Host: GitHub
- URL: https://github.com/asmeurer/markov
- Owner: asmeurer
- License: other
- Created: 2014-05-04T01:29:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-09T23:32:01.000Z (over 10 years ago)
- Last Synced: 2024-11-08T08:51:54.336Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Generate Markov Text from your Hangouts Chat
This uses https://github.com/TehMillhouse/PyMarkovChain to generate random
sentences from your Google Hangouts chat using Markov Chains.### How to use
You need to go to https://www.google.com/settings/takeout/custom and download
your hangouts as json. Then go in and find the chat you are interested in. For
me, it was the most recent one, so (in Python)```py
>>> import json
>>> from os.path import expanduser
>>> a = json.load(open(expanduser('~/Downloads/[email protected]/Hangouts/Hangouts.json')))
>>> b = a['conversation_state']
>>> c = b[-1] # You'll want to look at the elements of b to get the chat you are interested in
>>> json.dump(c['event'], open("hangouts.json")) # To this directory
```Then run
```bash
$ ./markov.py
```to generate a sentence. You can also supply a seed like,
```bash
$ ./markov.py you are
```