Skip to content

Commit

Permalink
calculating "words" is independent from search results
Browse files Browse the repository at this point in the history
  • Loading branch information
no6v committed Jan 1, 2012
1 parent d6eb092 commit 3523b95
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/earthquake/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,17 @@

command :search do |m|
search_options = config[:search_options] ? config[:search_options].dup : {}
words = m[1].split(/\s+/).reject{|x| x[0] =~ /^-|^(OR|AND)$/ }.map{|x|
case x
when /^from:(.+)/, /^to:(.+)/
$1
else
x
end
}
puts_items twitter.search(m[1], search_options)["results"].each { |s|
s["user"] = {"screen_name" => s["from_user"]}
s["_disable_cache"] = true
words = m[1].split(/\s+/).reject{|x| x[0] =~ /^-|^(OR|AND)$/ }.map{|x|
case x
when /^from:(.+)/, /^to:(.+)/
$1
else
x
end
}
s["_highlights"] = words
}
end
Expand Down

0 comments on commit 3523b95

Please sign in to comment.