Created
October 5, 2015 07:24
-
-
Save zetavg/c812443a170e7d4a6c90 to your computer and use it in GitHub Desktop.
csv_out
This file contains hidden or 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
| 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