diff --git a/README.md b/README.md index cbfb351..6bb508c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# twitter\_ebooks 2.2.4 +# twitter\_ebooks 2.2.5 Rewrite of my twitter\_ebooks code. While the original was solely a tweeting Markov generator, this framework helps you build any kind of interactive twitterbot which responds to mentions/DMs. diff --git a/lib/twitter_ebooks/model.rb b/lib/twitter_ebooks/model.rb index 96674d2..b625046 100644 --- a/lib/twitter_ebooks/model.rb +++ b/lib/twitter_ebooks/model.rb @@ -29,8 +29,10 @@ module Ebooks end elsif path.split('.')[-1] == "csv" log "Reading CSV corpus from #{path}" + header = CSV.read(path).first + text_col = header.index('text') lines = CSV.read(path).drop(1).map do |tweet| - tweet[5] + tweet[text_col] end else log "Reading plaintext corpus from #{path}" diff --git a/lib/twitter_ebooks/version.rb b/lib/twitter_ebooks/version.rb index ab9a31b..1d6a05b 100644 --- a/lib/twitter_ebooks/version.rb +++ b/lib/twitter_ebooks/version.rb @@ -1,3 +1,3 @@ module Ebooks - VERSION = "2.2.4" + VERSION = "2.2.5" end