require_relative 'src/<%= bot_name %>.rb' require "twitter" require "tweetstream" Twitter.configure do |config| config.consumer_key = ENV['TWITTER_CONSUMER_KEY'] config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] config.oauth_token = ENV['TWITTER_OAUTH_TOKEN'] config.oauth_token_secret = ENV['TWITTER_OAUTH_SECRET'] end TweetStream.configure do |config| config.consumer_key = ENV['TWITTER_CONSUMER_KEY'] config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] config.oauth_token = ENV['TWITTER_OAUTH_TOKEN'] config.oauth_token_secret = ENV['TWITTER_OAUTH_SECRET'] config.auth_method = :oauth end TweetStream::Client.new.userstream do |tweet| # your bot should have a method called respond_to(text) # when someone tweets @ your bot, it will reply back! puts "@#{tweet.user.screen_name} asks: #{tweet.text}" begin puts (answer = <%= class_name %>.respond_to tweet.text) Twitter.update(answer, :in_reply_to_status_id => tweet.id) rescue => e puts e end end