Browse Source

Save the main worksheet as it is

theenglishway (time) 2 năm trước cách đây
mục cha
commit
15e73154fa
1 tập tin đã thay đổi với 29 bổ sung5 xóa
  1. 29 5
      src/main/scala/main.worksheet.sc

+ 29 - 5
src/main/scala/main.worksheet.sc

@@ -2,10 +2,10 @@ import extract._
 import balldontlie._
 import game._
 
-val team_ids = List(24)
+val team_ids = List(23)
 
-val list_games = Extract.getStats
-list_games.size
+val list_games = Extract.getStats()
+// list_games.size
 
 val p = Player(
   id = 1,
@@ -19,5 +19,29 @@ val response = EndpointResponse.getTeams()
 
 List(1, 2, 3).mkString(",")
 
-Utils.writeToFile(list_games.sortBy(_.id), os.pwd / "game_data.json")
-Utils.writeToFile(response.sortBy(_.id), os.pwd / "teams_data.json")
+// Utils.writeToFile(list_games.sortBy(_.id), os.pwd / "game_data.json")
+// Utils.writeToFile(response.sortBy(_.id), os.pwd / "teams_data.json")
+
+val gamesIds = List(467898, 459139, 463449, 474597, 474565, 474525, 474600,
+  474582, 474612, 474553, 451511, 452668, 474638, 846095, 834978, 832818,
+  844943, 837568, 843183, 839441, 841600, 846955, 850125, 848973, 851564,
+  847821, 474394, 474507, 474281, 474302, 474327, 474412, 474176, 474496,
+  474218, 474204, 474241, 474223, 474359, 474439, 474290, 474263, 474305,
+  474346, 474427, 474464, 474471, 474190, 474372, 474386, 474445, 473813,
+  474072, 474044, 474028, 473824, 473913, 473972, 473900, 474139, 473840,
+  473891, 474090, 473796, 473863, 473929, 474152, 473941, 473877, 474000,
+  473956, 474103, 474120, 474166, 473987, 474023, 473363, 473514, 473576,
+  473610, 473630, 473691, 473441, 473421, 473605, 473546, 473559, 473496,
+  473585, 473725, 473469, 473668, 473707, 473531, 473675, 473641, 473762,
+  473742, 473739, 473659, 473432)
+
+//val stats = EndpointResponse.getStats(gamesIds)
+val stats3 = EndpointResponse.getStats(List(473514))
+
+val first_stats = stats3(0)
+first_stats.gameId
+
+val value = PlayerGameStats.as_json_value(stats3)
+
+Utils.writeToFile(value, os.pwd / "stats_3.json")
+