class THA::Connection
Public Class Methods
new(opts = {})
click to toggle source
Calls superclass method
# File lib/tcs-handles-aggregator/connection.rb, line 4 def initialize(opts = {}) super end
Public Instance Methods
collect_with_max_id(collection=[], max_id=nil) { |max_id| ... }
click to toggle source
# File lib/tcs-handles-aggregator/connection.rb, line 8 def collect_with_max_id(collection=[], max_id=nil, &block) response = yield max_id collection += response response.empty? ? collection.flatten : collect_with_max_id(collection, response.last.id - 1, &block) end
get_all_tweets(user)
click to toggle source
# File lib/tcs-handles-aggregator/connection.rb, line 14 def get_all_tweets(user) collect_with_max_id do |max_id| options = {:count => 200, :include_rts => true} options[:max_id] = max_id unless max_id.nil? user_timeline(user, options) end end