Permalink
Browse files

Added result_type to search for popular, recent search

  • Loading branch information...
1 parent 7e9b175 commit c32fa818f8331a7ff02f04f6cba8739423902029 @pengwynn pengwynn committed Mar 20, 2010
Showing with 13 additions and 0 deletions.
  1. +1 −0 History
  2. +6 −0 lib/twitter/search.rb
  3. +6 −0 test/twitter/search_test.rb
View
@@ -1,4 +1,5 @@
0.9.0 - March 20, 2010
+ * Added support for popular/recent search
* Patch from @sferik for API versioning and bulk user import
* Patch from @abozanich for search exclusions
0.8.6 - March 11, 2010
View
@@ -59,6 +59,12 @@ def lang(lang)
@query[:lang] = lang
self
end
+
+ # popular|recent
+ def result_type(result_type)
+ @query[:result_type] = result_type
+ self
+ end
# Limits the number of results per page
def per_page(num)
@@ -126,6 +126,12 @@ class SearchTest < Test::Unit::TestCase
@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 set the result type" do
+ @search.result_type("popular")
+ @search.class.expects(:get).with('http://search.twitter.com/search.json', :query => {:result_type => 'popular', :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 c32fa81

Please sign in to comment.