Will randomly add another sentence for short tweets

This commit is contained in:
Jacob Harris
2013-07-30 13:48:15 -04:00
parent fb7d794f71
commit 3e8bdfba47

View File

@@ -77,6 +77,11 @@ else
tweet.gsub(/\s\w+.$/, '') # randomly losing the last word sometimes like horse_ebooks
end
if tweet.length < 40 && rand(5) == 0
puts "Short tweet. Adding another sentence randomly"
tweet += " #{markov.generate_sentence}"
end
if !params["tweet"]
puts "MARKOV: #{tweet}"
end