Module: TwitterWithAutoPagination::REST::Lists

Includes:
Utils
Included in:
API
Defined in:
lib/twitter_with_auto_pagination/rest/lists.rb

Constant Summary

Constants included from Utils

Utils::DEFAULT_CALL_LIMIT

Instance Method Summary collapse

Methods included from Collector

#collect_with_cursor, #collect_with_max_id

Instance Method Details

#list_members(*args) ⇒ Object

Returns the members of the specified list.



19
20
21
22
23
24
25
26
# File 'lib/twitter_with_auto_pagination/rest/lists.rb', line 19

def list_members(*args)
  options = {count: 5000, skip_status: 1, cursor: -1}.merge(args.extract_options!)

  collect_with_cursor do |next_cursor|
    options[:next_cursor] = next_cursor unless next_cursor.nil?
    twitter.send(:list_members, *args, options)
  end
end

#memberships(*args) ⇒ Object

Returns the lists the specified user has been added to.



9
10
11
12
13
14
15
16
# File 'lib/twitter_with_auto_pagination/rest/lists.rb', line 9

def memberships(*args)
  options = {count: 1000, cursor: -1}.merge(args.extract_options!)

  collect_with_cursor do |next_cursor|
    options[:next_cursor] = next_cursor unless next_cursor.nil?
    twitter.send(:memberships, *args, options)
  end
end