lib/t/search.rb in t-0.9.4 vs lib/t/search.rb in t-0.9.5
- old
+ new
@@ -32,11 +32,13 @@
method_option "csv", :aliases => "-c", :type => :boolean, :default => false, :desc => "Output in CSV format."
method_option "long", :aliases => "-l", :type => :boolean, :default => false, :desc => "Output in long format."
method_option "number", :aliases => "-n", :type => :numeric, :default => DEFAULT_NUM_RESULTS
def all(query)
rpp = options['number'] || DEFAULT_NUM_RESULTS
- statuses = client.search(query, :include_entities => false, :rpp => rpp)
+ statuses = collect_with_rpp(rpp) do |opts|
+ client.search(query, opts)
+ end
if options['csv']
say ["ID", "Posted at", "Screen name", "Text"].to_csv unless statuses.empty?
statuses.each do |status|
say [status.id, status.created_at.utc.strftime("%Y-%m-%d %H:%M:%S %z"), status.from_user, HTMLEntities.new.decode(status.text)].to_csv
end
@@ -54,15 +56,14 @@
end
else
say unless statuses.empty?
statuses.each do |status|
if STDOUT.tty? && !options['no-color']
- say(" #{Thor::Shell::Color::BOLD}@#{status.from_user}", :yellow)
- print_wrapped(HTMLEntities.new.decode(status.text), :indent => 3)
+ say(" @#{status.from_user}", [:bold, :yellow])
else
say(" @#{status.from_user}")
- print_wrapped(HTMLEntities.new.decode(status.text), :indent => 3)
end
+ print_wrapped(HTMLEntities.new.decode(status.text), :indent => 3)
say
end
end
end