require 'twitter_ebooks'

class MyBot < Ebooks::Bot
  # Configuration here applies to all MyBots
  def configure

    self.consumer_key = ENV['TWITTER_CONSUMER_KEY']
    self.consumer_secret = ENV['TWITTER_CONSUMER_SECRET']

  end

  def on_startup
    model = Ebooks::Model.load("model/text.model")
    scheduler.cron '0 6,18,22 * * * America/New_York' do
      tweet(model.make_statement(140))
    end
  end
end

# Make a MyBot and attach it to an account
MyBot.new("mage__ebooks") do |bot|
  bot.access_token = ENV['TWITTER_ACCESS_TOKEN']
  bot.access_token_secret = ENV['TWITTER_ACCESS_TOKEN_SECRET']
end