Skip to content

Instantly share code, notes, and snippets.

@natlownes
Created December 20, 2012 17:47
Show Gist options
  • Save natlownes/4347164 to your computer and use it in GitHub Desktop.
Save natlownes/4347164 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rest-client'
require 'json'
#
# get all users in a program
#
client_id = 1069416700
client_api_key = 'b26420242ff0a48b192ddc4fa3e4ac96'
program_id = 1069416845
base_url = "http://#{client_id}:#{client_api_key}@zing.phl.looting.biz:3333"
program_cycles = RestClient.get(
"#{base_url}/apis/v1/groups/#{program_id}/children.json"
)
users = JSON.parse(program_cycles).map do |group|
users_for_group = RestClient.get(
"#{base_url}/apis/v1/groups/#{group['id']}/users.json"
)
JSON.parse(users_for_group)
end.flatten
users.each do |u|
puts u['email']
end
#
# get all conversations that a specific
# advisor participated in
#
#
# get all answers for a specific question
# in a program
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment