Top Level Namespace

Defined Under Namespace

Modules: Chatterbot Classes: Hash, StreamingHandler

Constant Summary

Constants included from Chatterbot::Config

Chatterbot::Config::MAX_TWEET_ID

Instance Attribute Summary

Attributes included from Chatterbot::Blacklist

#blacklist, #exclude

Attributes included from Chatterbot::Config

#config

Instance Method Summary collapse

Methods included from Chatterbot::Blacklist

#add_to_blacklist, #on_blacklist?, #on_global_blacklist?, #skip_me?

Methods included from Chatterbot::Logging

#critical, #debug, #log

Methods included from Chatterbot::DB

#db, #display_db_config_notice

Methods included from Chatterbot::Config

#bot_config, #chatterbot_helper?, #client_params, #config_file, #config_to_save, #db_config, #debug_mode=, #debug_mode?, #global_config, #global_config_files, #has_config?, #has_db?, #has_sequel?, #load_config, #log_dest, #log_tweets?, #logging?, #max_id_from, #needs_api_key?, #needs_auth_token?, #no_update=, #reset_bot?, #since_id, #since_id=, #since_id_reply, #since_id_reply=, #slurp_file, #store_database_config, #store_local_config, #update_config, #update_config?, #update_config_at_exit, #update_since_id, #update_since_id_reply, #verbose=, #verbose?, #working_dir

Methods included from Chatterbot::Helpers

#botname, #botname=, #from_user, #replace_variables, #tweet_user

Methods included from Chatterbot::DSL

#bad_words, #blacklist, #bot, #client, #consumer_key, #consumer_secret, #db, #debug_mode, #exclude, #favorite, #follow, #followers, #no_update, #only_interact_with_followers, #profile_text, #profile_website, #replies, #reply, #retweet, #search, #secret, #since_id, #since_id_reply, #streaming, #streaming_tweets, #token, #tweet, #update_config, #verbose, #whitelist

Instance Method Details

#count_for_period(bot, days = 1) ⇒ Object

return total number of tweets sent in last ‘days’ days



46
47
48
# File 'bin/chatterbot-status', line 46

def count_for_period(bot, days=1)
  db[:tweets].filter(:bot => bot[:id]).filter{created_at > (Time.now - (days*86400))}.count
end