Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added max to search to specify max_id for searches.

  • Loading branch information...
commit e79cc1fdb306da24462c6617b118e03ccbead9f1 1 parent 18afb3f
@jnunemaker jnunemaker authored
Showing with 15 additions and 0 deletions.
  1. +4 −0 History
  2. +5 −0 lib/twitter/search.rb
  3. +6 −0 test/twitter/search_test.rb
View
4 History
@@ -1,3 +1,7 @@
+0.6.2 - April 14, 2009
+* 1 minor addition
+ * added max to search so you can set the max id that should be used
+
0.6.1 - April 12, 2009
* 1 minor fix
* Had two friend_ids functions. Renamed one of them to follower_ids.
View
5 lib/twitter/search.rb
@@ -75,6 +75,11 @@ def geocode(long, lat, range)
self
end
+ def max(id)
+ @query[:max_id] = id
+ self
+ end
+
# Clears all the query filters to make a new search
def clear
@fetch = nil
View
6 test/twitter/search_test.rb
@@ -72,6 +72,12 @@ class SearchTest < Test::Unit::TestCase
@search.fetch()
end
+ should "should be able to specify max id" do
+ @search.max(1234)
+ @search.class.expects(:get).with('http://search.twitter.com/search.json', :query => {:max_id => 1234, :q => ''}, :format => :json).returns({'foo' => 'bar'})
+ @search.fetch()
+ end
+
should "should be able to clear the filters set" do
@search.from('jnunemaker').to('oaknd1')
@search.clear.query.should == {:q => []}
Please sign in to comment.
Something went wrong with that request. Please try again.