#!/usr/bin/env ruby
require File.expand_path('../../../config/environment', __FILE__)

ENV["RUN_REMOTE"] = "true"
key = Swars::BattleKey["paniniBoy-nnmmso-20230913_212637"]
Swars::Battle.find_by(key: key.to_s)&.destroy!
Swars::Importer::BattleImporter.new(key: key).call
tp Swars::Battle.last
# >> [fetch][record] https://shogiwars.heroz.jp/games/paniniBoy-nnmmso-20230913_212637?locale=ja
# >> |--------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
# >> |                 id | 67                                                                                                                                                                                                                                                                  |
# >> |                key | paniniBoy-nnmmso-20230913_212637                                                                                                                                                                                                                                    |
# >> |         battled_at | 2023-09-13 21:26:37 +0900                                                                                                                                                                                                                                           |
# >> |            csa_seq | [["+7776FU", 3598], ["-3334FU", 3599], ["+6766FU", 3598], ["-4344FU", 3598], ["+2868HI", 3597], ["-8242HI", 3597], ["+6958KI", 3596], ["-5162OU", 3596], ["+5948OU", 3595], ["-4152KI", 3595], ["+4838OU", 3594], ["-6272OU", 3595], ["+4948KI", 3594], ["-6162K... |
# >> |        win_user_id | 114                                                                                                                                                                                                                                                                 |
# >> |           turn_max | 185                                                                                                                                                                                                                                                                 |
# >> |          meta_info | {}                                                                                                                                                                                                                                                                  |
# >> |        accessed_at | 2023-09-16 13:29:39 +0900                                                                                                                                                                                                                                           |
# >> |          sfen_body | position sfen lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1 moves 7g7f 3c3d 6g6f 4c4d 2h6h 8b4b 6i5h 5a6b 5i4h 4a5b 4h3h 6b7b 4i4h 6a6b 3i2h 7a8b 8h7g 2b3c 7i7h 4b2b 7h6g 2c2d 6g5f 2d2e 7g8f 3a4b 8i7g 2e2f 2g2f 2b2f 2h2g 2f2b P*2f 3d3e 1g... |
# >> |          sfen_hash | 0f145ce89a211603b70f0ef0d03f6dfc                                                                                                                                                                                                                                    |
# >> |         start_turn |                                                                                                                                                                                                                                                                     |
# >> |      critical_turn | 28                                                                                                                                                                                                                                                                  |
# >> |      outbreak_turn | 45                                                                                                                                                                                                                                                                  |
# >> |         image_turn |                                                                                                                                                                                                                                                                     |
# >> |         created_at | 2023-09-16 13:29:39 +0900                                                                                                                                                                                                                                           |
# >> |         updated_at | 2023-09-16 13:29:39 +0900                                                                                                                                                                                                                                           |
# >> |           xmode_id | 16                                                                                                                                                                                                                                                                  |
# >> |          preset_id | 96                                                                                                                                                                                                                                                                  |
# >> |            rule_id | 18                                                                                                                                                                                                                                                                  |
# >> |           final_id | 40                                                                                                                                                                                                                                                                  |
# >> |   defense_tag_list |                                                                                                                                                                                                                                                                     |
# >> |    attack_tag_list |                                                                                                                                                                                                                                                                     |
# >> | technique_tag_list |                                                                                                                                                                                                                                                                     |
# >> |      note_tag_list |                                                                                                                                                                                                                                                                     |
# >> |     other_tag_list |                                                                                                                                                                                                                                                                     |
# >> |--------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
