Sha256: 2fc3a55c66e9b8f3923dd3555d5198358ab4e8eab7c404878c2faa90bfc35f59

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

require 'jsonclient'

class Wechat::Core::Follower

  # 获取关注者列表
  # http://mp.weixin.qq.com/wiki/0/d0e07720fc711c02a3eab6ec33054804.html
  #
  # Return hash format if success:
  # {
  #   total: <TOTAL>,
  #   count: <COUNT>,
  #   data: { openid: [ <OPEN_ID_1>, <OPEN_ID_2>, ... ] },
  #   next_openid: <NEXT_OPEN_ID>
  # }
  def self.index(access_token, next_open_id = nil)

    options = { access_token: access_token }
    options[:next_openid] = next_open_id if next_open_id.present?

    message = ::JSONClient.new.get 'https://api.weixin.qq.com/cgi-bin/user/get', options
    message.body
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wechat-core-0.3 lib/wechat/core/follower.rb