Last active
February 15, 2020 10:01
-
-
Save zaru/33511975e5b55e957dcc84c643278343 to your computer and use it in GitHub Desktop.
サポーターズ学生フィードバック集計スクリプト
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
for i in {1..12}; do | |
curl --anyauth --user user:password \ | |
-H 'content-type: application/json' \ | |
https://viewer.kintoneapp.com/public/api/records/xxxxxx/$i > ./files/$i.json | |
done |
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
require 'json' | |
point_list = [] | |
comment_list = [] | |
(1..12).each do |i| | |
json = JSON.parse(File.read("./files/#{i}.json")) | |
json['records'].each do |data| | |
company = data['company_name']['value'] | |
points = data['チェックボックス']['value'] | |
comment = data['presen_opinion']['value'] | |
points.each do |point| | |
point_list << [ | |
company, | |
point, | |
].join("\t") | |
end | |
comment_list << [ | |
company, | |
comment | |
].join("\t") | |
end | |
end | |
puts point_list.join("\n") if ARGV[0] == 'point' | |
puts comment_list.join("\n") if ARGV[0] == 'comment' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment