Sha256: f1cfbb9008018bf61713603e2d1d6ad62b3178fbf1bdd38eda65119785ad5cea

Contents?: true

Size: 660 Bytes

Versions: 4

Compression:

Stored size: 660 Bytes

Contents

module Chatterbot

  #
  # methods for checking the bots timeline
  module HomeTimeline

    # handle the bots timeline
    def home_timeline(*args, &block)
      return unless require_login
      debug "check for home_timeline tweets since #{since_id_home_timeline}"

      opts = {
        :since_id => since_id_home_timeline,
        :count => 200
      }
      results = client.home_timeline(opts)

      @current_tweet = nil
      results.each { |s|
        update_since_id_home_timeline(s)
        if block_given? && valid_tweet?(s)
          @current_tweet = s
          yield s         
        end
      }
      @current_tweet = nil
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chatterbot-2.2.0 lib/chatterbot/home_timeline.rb
chatterbot-2.1.0 lib/chatterbot/home_timeline.rb
chatterbot-2.0.5 lib/chatterbot/home_timeline.rb
chatterbot-2.0.4 lib/chatterbot/home_timeline.rb