Skip to content

Instantly share code, notes, and snippets.

@zaru
Last active February 15, 2020 10:01
Show Gist options
  • Save zaru/33511975e5b55e957dcc84c643278343 to your computer and use it in GitHub Desktop.
Save zaru/33511975e5b55e957dcc84c643278343 to your computer and use it in GitHub Desktop.
サポーターズ学生フィードバック集計スクリプト
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
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