Skip to content

Instantly share code, notes, and snippets.

@kui
Created May 23, 2012 09:55
Show Gist options
  • Save kui/2774341 to your computer and use it in GitHub Desktop.
Save kui/2774341 to your computer and use it in GitHub Desktop.
ruby で yammer の最近の新規登録者のメールアドレス 50 件とる
# A sample script for 'yammer' rubygem
# You must do the followings to execute this script
# * `gem install yammer`
# * get consumer_key and consumer_secret from https://www.yammer.com/client_applications/new
# * get access_token from https://developer.yammer.com/api/sandbox.html
require 'rubygems'
require 'yammer'
client = Yammer.new
opts = {
:access_token => 'INPUT your access_token',
:sort_by => 'date_joined'
}
result = client.get("users", opts, :json)
p result.length
result.each do |user|
addrs = user.contact.email_addresses if user.contact
p addrs.first.address if addrs and addrs.first
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment