def timeline(*args)
opts = {:count => MAX_NUM_RESULTS}
query = args.pop
user = args.pop
if user
user = if options['id']
user.to_i
else
user.strip_ats
end
statuses = collect_with_max_id do |max_id|
opts[:max_id] = max_id unless max_id.nil?
client.user_timeline(user, opts)
end
else
statuses = collect_with_max_id do |max_id|
opts[:max_id] = max_id unless max_id.nil?
client.home_timeline(opts)
end
end
statuses = statuses.select do |status|
/#{query}/i.match(status.text)
end
print_statuses(statuses)
end