Permalink
Browse files

Phrase search from @zagari

  • Loading branch information...
1 parent f09b312 commit e3e8f7e4b1ea8a315f935805e409a3fff6a5483d @pengwynn pengwynn committed Feb 11, 2010
Showing with 15 additions and 0 deletions.
  1. +3 −0 History
  2. +6 −0 lib/twitter/search.rb
  3. +6 −0 test/twitter/search_test.rb
View
@@ -1,3 +1,6 @@
+0.8.4 - February 11, 2010
+ * Added membership query options // thanks ming yeow ng
+ * Added support for a phrase search (instead of a group of words) from @zagari
0.8.3 - January 29, 2010
* Added patch for unauthenticated list timelines from @spastorino
0.8.2 - January 21, 2010
View
@@ -43,6 +43,12 @@ def hashed(tag)
@query[:q] << "##{tag}"
self
end
+
+ # Search for a phrase instead of a group of words
+ def phrase(phrase)
+ @query[:phrase] = phrase
+ self
+ end
# lang must be ISO 639-1 code ie: en, fr, de, ja, etc.
#
@@ -104,6 +104,12 @@ class SearchTest < Test::Unit::TestCase
@search.class.expects(:get).with('http://search.twitter.com/search.json', :query => {:max_id => 1234, :q => ''}, :format => :json, :headers => {'User-Agent' => 'Ruby Twitter Gem'}).returns({'foo' => 'bar'})
@search.fetch()
end
+
+ should "should be able to set the phrase" do
+ @search.phrase("Who Dat")
+ @search.class.expects(:get).with('http://search.twitter.com/search.json', :query => {:phrase => "Who Dat", :q => ''}, :format => :json, :headers => {'User-Agent' => 'Ruby Twitter Gem'}).returns({'foo' => 'bar'})
+ @search.fetch()
+ end
should "should be able to clear the filters set" do
@search.from('jnunemaker').to('oaknd1')

0 comments on commit e3e8f7e

Please sign in to comment.