sixohsix/twitter — pull request #260 by BigBlueHat (2014-10-22 17:43:11+00:00)
Title: Use YAML for twitter-log output

First @sixohsix, thanks for building this project! :smiley_cat:

Second, I found the twitter-log output looked very similar to YAML, but was less auto-magically parse-able with existing tools. This PR includes a change to YAML (just for twitter-log at this point) which can easily be converted into JSON, XML, etc. (using PyYAML, etc) while remaining legible to mere mortals. :smiley:

It looks essentially like this:
```yaml
bigbluehat:
- ID: 524566522782842880
Date: Tue Oct 21 14:22:59 +0000 2014
Tweet: |
RT @darylginn: How I use todo apps:
1. Write some todos.
2. Never open the app again.
3. Delete app.
- ID: 524011979380654080
Date: Mon Oct 20 01:39:26 +0000 2014
Tweet: |
@CUGreenville how about adding "chaider" to your menu? "chai steeped in cider instead of water." -- @_beechnut
```

Parsed with PyYAML, it looks like this:
```python
{'bigbluehat': [{'Date': ..., 'Tweet': ...}, ..., ...]}
```

So Tweets can be referenced in loops, list comprehension, etc.

It would be a simple tweak to output this in two other variations:
1. each tweet is a distinct YAML document (which would include the `screen_name` in the document)
2. make the output an keyed dictionary, rather than a list.

The current format seemed to provide the most flexibility, but let me know if you'd like me to send PRs for the others (or if this is totally not something you want :wink:).

Thanks again, @sixohsix