Skip to content

Commit

Permalink
Added cursor to lists method
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Mar 21, 2010
1 parent 6f23c5e commit a16ad35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/twitter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,15 @@ def list_delete(list_owner_username, slug)
perform_delete("/#{API_VERSION}/#{list_owner_username}/lists/#{slug}.json")
end

def lists(list_owner_username=nil)
def lists(list_owner_username = nil, cursor = nil)
if list_owner_username
path = "/#{API_VERSION}/#{list_owner_username}/lists.json"
else
path = "/#{API_VERSION}/lists.json"
end
perform_get(path)
query = {}
query[:cursor] = cursor if cursor
perform_get(path, :query => query)
end

def list(list_owner_username, slug)
Expand All @@ -267,9 +269,9 @@ def memberships(list_owner_username, query={})
end

def list_members(list_owner_username, slug, cursor = nil)
path = "/#{API_VERSION}/#{list_owner_username}/#{slug}/members.json"
path += "?cursor=#{cursor}" if cursor
perform_get(path)
query = {}
query[:cursor] = cursor if cursor
perform_get("/#{API_VERSION}/#{list_owner_username}/#{slug}/members.json", :query => query)
end

def list_add_member(list_owner_username, slug, new_id)
Expand Down

0 comments on commit a16ad35

Please sign in to comment.