Skip to content

Commit

Permalink
Added max to search to specify max_id for searches.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Apr 14, 2009
1 parent 18afb3f commit e79cc1f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions History
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 5 additions & 0 deletions lib/twitter/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/twitter/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 => []}
Expand Down

0 comments on commit e79cc1f

Please sign in to comment.