Created
September 4, 2012 15:45
-
-
Save aitor/3622613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| › ll writers-watching-football | |
| total 48 | |
| drwxr-xr-x 10 aitor staff 340B Jun 11 15:28 .git | |
| -rw-r--r-- 1 aitor staff 83B Jun 8 15:34 Gemfile | |
| -rw-r--r-- 1 aitor staff 1.1K Jun 8 15:34 Gemfile.lock | |
| -rw-r--r-- 1 aitor staff 28B Jun 7 23:42 Procfile | |
| -rw-r--r-- 1 aitor staff 1.6K Jun 10 22:34 bot.rb | |
| drwxr-xr-x 6 aitor staff 204B Jun 8 17:51 data | |
| -rw-r--r-- 1 aitor staff 598B Jun 8 16:35 scrap.rb | |
| -rw-r--r-- 1 aitor staff 470B Jun 10 22:39 writer.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ... skipped ... | |
| EM.run do | |
| hemingway = TweetStream::Client.new | |
| markov = MarkyMarkov::TemporaryDictionary.new(2) | |
| files_for("hemingway").each do |file| | |
| markov.parse_file file | |
| end | |
| hemingway.track('Euro2012') do |status| | |
| hemingway.update(markov.generate_1_sentences) | |
| end | |
| hemingway.on_error do |message| | |
| puts message | |
| end | |
| end | |
| # ... skipped ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment