Created
May 23, 2012 09:55
-
-
Save kui/2774341 to your computer and use it in GitHub Desktop.
ruby で yammer の最近の新規登録者のメールアドレス 50 件とる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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