Skip to content
This repository
Browse code

Quick addition of cursor param for list_members

Twitter API docs say the cursor param is optional, but paged results
(max of 20) are returned whether or not you include a cursor.
At least for the time being, you *must* page through list members.
  • Loading branch information...
commit 9f393f05c127623f4c58a68e2246a3553f225349 1 parent 31341b3
Michael D. Ivey ivey authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 lib/twitter/base.rb
6 lib/twitter/base.rb
@@ -212,8 +212,10 @@ def memberships(list_owner_username)
212 212 perform_get("/#{list_owner_username}/lists/memberships.json")
213 213 end
214 214
215   - def list_members(list_owner_username, slug)
216   - perform_get("/#{list_owner_username}/#{slug}/members.json")
  215 + def list_members(list_owner_username, slug, cursor = nil)
  216 + path = "/#{list_owner_username}/#{slug}/members.json"
  217 + path += "?cursor=#{cursor}" if cursor
  218 + perform_get(path)
217 219 end
218 220
219 221 def list_add_member(list_owner_username, slug, new_id)

0 comments on commit 9f393f0

Please sign in to comment.
Something went wrong with that request. Please try again.