Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added cursor to lists method

  • Loading branch information...
commit a16ad354be4fae3d3f86207d8c5ae8b4c2a11b52 1 parent 6f23c5e
Erik Michaels-Ober authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/twitter/base.rb
12 lib/twitter/base.rb
View
@@ -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)
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.