Skip to content

Instantly share code, notes, and snippets.

@zetavg
Created October 5, 2015 07:24
Show Gist options
  • Select an option

  • Save zetavg/c812443a170e7d4a6c90 to your computer and use it in GitHub Desktop.

Select an option

Save zetavg/c812443a170e7d4a6c90 to your computer and use it in GitHub Desktop.
csv_out
CSV.open("./form.csv", "wb") do |csv|
TutorAbcForm.find_each do |form|
user = form.user
uid = user.sid
raw_user = JSON.parse RestClient.get("https://colorgy.io/api/v1/users/#{uid }?access_token=#{access_token}")
row = []
row << raw_user['name']
row << raw_user['possible_organization_code']
row << raw_user['possible_department_code']
row << raw_user['possible_started_year']
row << form.mobile_phone_number
row << form.if_heard_tutor_abc
csv << row
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment