Closed yusuko closed 5 years ago
UPDATE twitter_accounts
SET worksheet_name = "Playerapp_vb"
WHERE name = "Playerapp_vb";
DELETE FROM twitter_accounts
WHERE name = "shogi_ask";
herokuでのみ、csvのillegal quotingエラーが発生した。
/app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1912:in `block (2 levels) in shift': Illegal quoting in line 2. (CSV::MalformedCSVError)
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1868:in `each'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1868:in `block in shift'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1828:in `loop'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1828:in `shift'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1770:in `each'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1784:in `to_a'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1784:in `read'
from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1324:in `parse'
from /app/google_sheet_client.rb:16:in `write_in_spreadsheet'
from script.rb:14:in `block in <main>'
from script.rb:9:in `each'
from script.rb:9:in `<main>'
失敗しているCSV
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049656543589875712\",\"https://twitter.com/Playerapp_cbsk/status/1049656543589875712\",\"大学生の皆さんーー!!\n絶対楽しいのでぜひぜひ参加下さい😊 https://t.co/90pPlcUF2L\",\"2018-10-09 13:43 +0000\",\"1216.0\",\"4.0\",\"0.003289473684210526\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049164532881358848\",\"https://twitter.com/Playerapp_cbsk/status/1049164532881358848\",\"おおー!!\n大学バスケでもやろうかなー需要あるかなーー😎\n\n#高校バスケ #ウインターカップ #大学バスケ https://t.co/snkoMweMAT\",\"2018-10-08 05:08 +0000\",\"1361.0\",\"6.0\",\"0.00440852314474651\",\"1.0\",\"0.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767660815609856\",\"https://twitter.com/Playerapp_cbsk/status/1048767660815609856\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n大東文化を応援🔥→「RT」\n早稲田(@w_basketball )を応援🔥→「いいね」\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/FWLsgTuy1I\",\"2018-10-07 02:51 +0000\",\"2954.0\",\"91.0\",\"0.030805687203791468\",\"3.0\",\"0.0\",\"7.0\",\"12.0\",\"13.0\",\"0.0\",\"16.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"439\",\"40\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767584500297728\",\"https://twitter.com/Playerapp_cbsk/status/1048767584500297728\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n早稲田(@w_basketball )を応援🔥→「RT」\n大東文化を応援🔥→「いいね」\n\nこちらも注目の1戦ですね👀\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/9VE8yifWO6\",\"2018-10-07 02:50 +0000\",\"3104.0\",\"75.0\",\"0.02416237113402062\",\"6.0\",\"0.0\",\"3.0\",\"18.0\",\"7.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"381\",\"36\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767298532663296\",\"https://twitter.com/Playerapp_cbsk/status/1048767298532663296\",\"【#大学バスケ 注目試合👀】\n\n早稲田 VS 大東文化\n10/7(日)15:40 TIP OFF!\n\n現在首位の大東文化に早稲田がどう挑むか💨\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/zvmK0LT97J\",\"2018-10-07 02:49 +0000\",\"908.0\",\"21.0\",\"0.023127753303964757\",\"1.0\",\"0.0\",\"0.0\",\"3.0\",\"14.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048388500695875584\",\"https://twitter.com/Playerapp_cbsk/status/1048388500695875584\",\"【#大学バスケ 注目試合👀】\n\n法政 VS 明星\n10/6(土)12:00 TIP OFF!\n\n好調を保つ法政に対し、\n明星はどんな戦略で挑むか楽しみです✍️\n\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/H1qt6a2YHS\",\"2018-10-06 01:44 +0000\",\"644.0\",\"9.0\",\"0.013975155279503106\",\"0.0\",\"0.0\",\"0.0\",\"4.0\",\"2.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
成功しているCSV
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049988972653363200\",\"https://twitter.com/Playerapp_tns/status/1049988972653363200\",\"上海ロレックス・マスターズシングルス 2回戦 錦織 vs ウー・イービン\n第2セットは錦織が6-0で取り返しました!\n勝負の行方は第3セットに!\n#上海マスターズ #錦織圭\n https://t.co/04g1oAzeP2\",\"2018-10-10 11:44 +0000\",\"313.0\",\"8.0\",\"0.025559105431309903\",\"0.0\",\"0.0\",\"0.0\",\"2.0\",\"3.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049980502139011073\",\"https://twitter.com/Playerapp_tns/status/1049980502139011073\",\"上海ロレックス・マスターズシングルス 2回戦 \n錦織 vs ウー・イービン\n第1セットは中国期待の若手ウーが6-3で先取!錦織挽回なるか!\n#上海マスターズ #錦織圭 \n https://t.co/rUswrZXx8d\",\"2018-10-10 11:10 +0000\",\"330.0\",\"14.0\",\"0.04242424242424243\",\"0.0\",\"0.0\",\"1.0\",\"3.0\",\"7.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048826246627385350\",\"https://twitter.com/Playerapp_tns/status/1048826246627385350\",\"楽天ジャパンオープンシングルス 決勝\nメドベージェフ vs 錦織\n試合開始です!!\n\nhttps://t.co/dH8I7d9tXC\",\"2018-10-07 06:43 +0000\",\"99.0\",\"10.0\",\"0.10101010101010101\",\"0.0\",\"0.0\",\"0.0\",\"0.0\",\"8.0\",\"0.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048783127278018560\",\"https://twitter.com/Playerapp_tns/status/1048783127278018560\",\"楽天ジャパンオープンシングルス 決勝\n メドベージェフ vs 錦織\n本日の15:30試合開始です!!\n錦織楽天オープン優勝なるか!Player!ではポイント速報を行います。皆さん応援しましょう!!\n#楽天オープン #錦織圭 \n\n https://t.co/e2flmDZ7vy\",\"2018-10-07 03:52 +0000\",\"430.0\",\"27.0\",\"0.06279069767441861\",\"0.0\",\"0.0\",\"2.0\",\"1.0\",\"19.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048498750279151618\",\"https://twitter.com/Playerapp_tns/status/1048498750279151618\",\"楽天ジャパンオープンシングルス \n準決勝 錦織 vs ガスケ\n錦織選手が7−6,6−1のストレートでガスケを下し、決勝進出です!!\n錦織強い! 優勝まであと1勝です!!\n#楽天オープン #決勝 #錦織圭 \nhttps://t.co/srlUNNrMKC\",\"2018-10-06 09:02 +0000\",\"389.0\",\"14.0\",\"0.03598971722365039\",\"0.0\",\"0.0\",\"2.0\",\"0.0\",\"10.0\",\"1.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048486806319128576\",\"https://twitter.com/Playerapp_tns/status/1048486806319128576\",\"楽天ジャパンオープンシングルス 準決勝 錦織 vs ガスケ\n第1セットは錦織がタイブレークを制しました!!! \n#楽天オープン #錦織がんばれ\n https://t.co/mTlczWODOY\",\"2018-10-06 08:15 +0000\",\"233.0\",\"2.0\",\"0.008583690987124463\",\"0.0\",\"0.0\",\"0.0\",\"1.0\",\"1.0\",\"0.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048458418355204098\",\"https://twitter.com/Playerapp_tns/status/1048458418355204098\",\"楽天ジャパンオープンシングルス 準決勝 \n錦織VSガスケ\n錦織2年ぶりのツアータイトルなるか!\n間もなく試合開始です!\n#楽天オープン #テニス #錦織圭 \n https://t.co/Tyuits5NWD\",\"2018-10-06 06:22 +0000\",\"403.0\",\"28.0\",\"0.06947890818858561\",\"1.0\",\"1.0\",\"0.0\",\"3.0\",\"22.0\",\"1.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1047344150851375105\",\"https://twitter.com/Playerapp_tns/status/1047344150851375105\",\"楽天オープン1回戦\n西岡VSキリオス\n強敵キリオスを相手に検討しましたが、惜しくも5-7,6-7で敗れてしまいました。\n西岡選手、お疲れ様です!!\n#西岡良仁 #楽天オープン\n https://t.co/xeFN6Ha5DC\",\"2018-10-03 04:34 +0000\",\"624.0\",\"11.0\",\"0.017628205128205128\",\"1.0\",\"0.0\",\"3.0\",\"0.0\",\"3.0\",\"1.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1047323948403240962\",\"https://twitter.com/Playerapp_tns/status/1047323948403240962\",\"楽天オープン1回戦\n西岡良仁VSニック・キリオス\n試合開始です!!\n西岡選手、強敵キリオスを相手に先週優勝の勢いに乗れるか注目の試合です!\n#楽天オープン #西岡 \n https://t.co/M8K1kefsCL\",\"2018-10-03 03:14 +0000\",\"491.0\",\"12.0\",\"0.024439918533604887\",\"0.0\",\"0.0\",\"0.0\",\"1.0\",\"10.0\",\"1.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1046730742867189766\",\"https://twitter.com/Playerapp_tns/status/1046730742867189766\",\"綿貫陽介選手がロビンハーセ選手に逆転勝利!\nATPツアーで初めての勝利を挙げました!!おめでとうございます!!!\n#楽天オープン #綿貫陽介\n\n楽天ジャパンオープンシングルス 1回戦 綿貫 vs ハーセ https://t.co/dKgWzjZyPP\",\"2018-10-01 11:57 +0000\",\"478.0\",\"6.0\",\"0.012552301255230125\",\"1.0\",\"0.0\",\"1.0\",\"0.0\",\"4.0\",\"0.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
res.body.force_encoding('utf-8').gsub(/\"/, "
)
にすると /nで区切られる。
各列は
"
\"A\",\"B\",\"C\",.....,\"AH\" \n
\"A\",\"B\",\"C\",.....,\"AH\" \n
....
....
\"A\",\"B\",\"C\",.....,\"AH\" \n
"
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049656543589875712\",\"https://twitter.com/Playerapp_cbsk/status/1049656543589875712\",\"大学生の皆さんーー!!\n絶対楽しいのでぜひぜひ参加下さい😊 https://t.co/90pPlcUF2L\",\"2018-10-09 13:43 +0000\",\"1216.0\",\"4.0\",\"0.003289473684210526\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049164532881358848\",\"https://twitter.com/Playerapp_cbsk/status/1049164532881358848\",\"おおー!!\n大学バスケでもやろうかなー需要あるかなーー😎\n\n#高校バスケ #ウインターカップ #大学バスケ https://t.co/snkoMweMAT\",\"2018-10-08 05:08 +0000\",\"1361.0\",\"6.0\",\"0.00440852314474651\",\"1.0\",\"0.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767660815609856\",\"https://twitter.com/Playerapp_cbsk/status/1048767660815609856\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n大東文化を応援🔥→「RT」\n早稲田(@w_basketball )を応援🔥→「いいね」\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/FWLsgTuy1I\",\"2018-10-07 02:51 +0000\",\"2954.0\",\"91.0\",\"0.030805687203791468\",\"3.0\",\"0.0\",\"7.0\",\"12.0\",\"13.0\",\"0.0\",\"16.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"439\",\"40\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767584500297728\",\"https://twitter.com/Playerapp_cbsk/status/1048767584500297728\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n早稲田(@w_basketball )を応援🔥→「RT」\n大東文化を応援🔥→「いいね」\n\nこちらも注目の1戦ですね👀\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/9VE8yifWO6\",\"2018-10-07 02:50 +0000\",\"3104.0\",\"75.0\",\"0.02416237113402062\",\"6.0\",\"0.0\",\"3.0\",\"18.0\",\"7.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"381\",\"36\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767298532663296\",\"https://twitter.com/Playerapp_cbsk/status/1048767298532663296\",\"【#大学バスケ 注目試合👀】\n\n早稲田 VS 大東文化\n10/7(日)15:40 TIP OFF!\n\n現在首位の大東文化に早稲田がどう挑むか💨\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/zvmK0LT97J\",\"2018-10-07 02:49 +0000\",\"908.0\",\"21.0\",\"0.023127753303964757\",\"1.0\",\"0.0\",\"0.0\",\"3.0\",\"14.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048388500695875584\",\"https://twitter.com/Playerapp_cbsk/status/1048388500695875584\",\"【#大学バスケ 注目試合👀】\n\n法政 VS 明星\n10/6(土)12:00 TIP OFF!\n\n好調を保つ法政に対し、\n明星はどんな戦略で挑むか楽しみです✍️\n\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/H1qt6a2YHS\",\"2018-10-06 01:44 +0000\",\"644.0\",\"9.0\",\"0.013975155279503106\",\"0.0\",\"0.0\",\"0.0\",\"4.0\",\"2.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049988972653363200\",\"https://twitter.com/Playerapp_tns/status/1049988972653363200\",\"上海ロレックス・マスターズシングルス 2回戦 錦織 vs ウー・イービン\n第2セットは錦織が6-0で取り返しました!\n勝負の行方は第3セットに!\n#上海マスターズ #錦織圭\n https://t.co/04g1oAzeP2\",\"2018-10-10 11:44 +0000\",\"313.0\",\"8.0\",\"0.025559105431309903\",\"0.0\",\"0.0\",\"0.0\",\"2.0\",\"3.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049980502139011073\",\"https://twitter.com/Playerapp_tns/status/1049980502139011073\",\"上海ロレックス・マスターズシングルス 2回戦 \n錦織 vs ウー・イービン\n第1セットは中国期待の若手ウーが6-3で先取!錦織挽回なるか!\n#上海マスターズ #錦織圭 \n https://t.co/rUswrZXx8d\",\"2018-10-10 11:10 +0000\",\"330.0\",\"14.0\",\"0.04242424242424243\",\"0.0\",\"0.0\",\"1.0\",\"3.0\",\"7.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048826246627385350\",\"https://twitter.com/Playerapp_tns/status/1048826246627385350\",\"楽天ジャパンオープンシングルス 決勝\nメドベージェフ vs 錦織\n試合開始です!!\n\nhttps://t.co/dH8I7d9tXC\",\"2018-10-07 06:43 +0000\",\"99.0\",\"10.0\",\"0.10101010101010101\",\"0.0\",\"0.0\",\"0.0\",\"0.0\",\"8.0\",\"0.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048783127278018560\",\"https://twitter.com/Playerapp_tns/status/1048783127278018560\",\"楽天ジャパンオープンシングルス 決勝\n メドベージェフ vs 錦織\n本日の15:30試合開始です!!\n錦織楽天オープン優勝なるか!Player!ではポイント速報を行います。皆さん応援しましょう!!\n#楽天オープン #錦織圭 \n\n https://t.co/e2flmDZ7vy\",\"2018-10-07 03:52 +0000\",\"430.0\",\"27.0\",\"0.06279069767441861\",\"0.0\",\"0.0\",\"2.0\",\"1.0\",\"19.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048498750279151618\",\"https://twitter.com/Playerapp_tns/status/1048498750279151618\",\"楽天ジャパンオープンシングルス \n準決勝 錦織 vs ガスケ\n錦織選手が7−6,6−1のストレートでガスケを下し、決勝進出です!!\n錦織強い! 優勝まであと1勝です!!\n#楽天オープン #決勝 #錦織圭 \nhttps://t.co/srlUNNrMKC\",\"2018-10-06 09:02 +0000\",\"389.0\",\"14.0\",\"0.03598971722365039\",\"0.0\",\"0.0\",\"2.0\",\"0.0\",\"10.0\",\"1.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048486806319128576\",\"https://twitter.com/Playerapp_tns/status/1048486806319128576\",\"楽天ジャパンオープンシングルス 準決勝 錦織 vs ガスケ\n第1セットは錦織がタイブレークを制しました!!! \n#楽天オープン #錦織がんばれ\n https://t.co/mTlczWODOY\",\"2018-10-06 08:15 +0000\",\"233.0\",\"2.0\",\"0.008583690987124463\",\"0.0\",\"0.0\",\"0.0\",\"1.0\",\"1.0\",\"0.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048458418355204098\",\"https://twitter.com/Playerapp_tns/status/1048458418355204098\",\"楽天ジャパンオープンシングルス 準決勝 \n錦織VSガスケ\n錦織2年ぶりのツアータイトルなるか!\n間もなく試合開始です!\n#楽天オープン #テニス #錦織圭 \n https://t.co/Tyuits5NWD\",\"2018-10-06 06:22 +0000\",\"403.0\",\"28.0\",\"0.06947890818858561\",\"1.0\",\"1.0\",\"0.0\",\"3.0\",\"22.0\",\"1.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1047344150851375105\",\"https://twitter.com/Playerapp_tns/status/1047344150851375105\",\"楽天オープン1回戦\n西岡VSキリオス\n強敵キリオスを相手に検討しましたが、惜しくも5-7,6-7で敗れてしまいました。\n西岡選手、お疲れ様です!!\n#西岡良仁 #楽天オープン\n https://t.co/xeFN6Ha5DC\",\"2018-10-03 04:34 +0000\",\"624.0\",\"11.0\",\"0.017628205128205128\",\"1.0\",\"0.0\",\"3.0\",\"0.0\",\"3.0\",\"1.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1047323948403240962\",\"https://twitter.com/Playerapp_tns/status/1047323948403240962\",\"楽天オープン1回戦\n西岡良仁VSニック・キリオス\n試合開始です!!\n西岡選手、強敵キリオスを相手に先週優勝の勢いに乗れるか注目の試合です!\n#楽天オープン #西岡 \n https://t.co/M8K1kefsCL\",\"2018-10-03 03:14 +0000\",\"491.0\",\"12.0\",\"0.024439918533604887\",\"0.0\",\"0.0\",\"0.0\",\"1.0\",\"10.0\",\"1.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1046730742867189766\",\"https://twitter.com/Playerapp_tns/status/1046730742867189766\",\"綿貫陽介選手がロビンハーセ選手に逆転勝利!\nATPツアーで初めての勝利を挙げました!!おめでとうございます!!!\n#楽天オープン #綿貫陽介\n\n楽天ジャパンオープンシングルス 1回戦 綿貫 vs ハーセ https://t.co/dKgWzjZyPP\",\"2018-10-01 11:57 +0000\",\"478.0\",\"6.0\",\"0.012552301255230125\",\"1.0\",\"0.0\",\"1.0\",\"0.0\",\"4.0\",\"0.0\",\"0.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
14:31実施時
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049656543589875712\",\"https://twitter.com/Playerapp_cbsk/status/1049656543589875712\",\"大学生の皆さんーー!!\n絶対楽しいのでぜひぜひ参加下さい😊 https://t.co/90pPlcUF2L\",\"2018-10-09 13:43 +0000\",\"1332.0\",\"4.0\",\"0.003003003003003003\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049164532881358848\",\"https://twitter.com/Playerapp_cbsk/status/1049164532881358848\",\"おおー!!\n大学バスケでもやろうかなー需要あるかなーー😎\n\n#高校バスケ #ウインターカップ #大学バスケ https://t.co/snkoMweMAT\",\"2018-10-08 05:08 +0000\",\"1578.0\",\"6.0\",\"0.0038022813688212928\",\"1.0\",\"0.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767660815609856\",\"https://twitter.com/Playerapp_cbsk/status/1048767660815609856\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n大東文化を応援🔥→「RT」\n早稲田(@w_basketball )を応援🔥→「いいね」\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/FWLsgTuy1I\",\"2018-10-07 02:51 +0000\",\"3276.0\",\"95.0\",\"0.028998778998779\",\"3.0\",\"0.0\",\"7.0\",\"13.0\",\"14.0\",\"0.0\",\"17.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"463\",\"41\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767584500297728\",\"https://twitter.com/Playerapp_cbsk/status/1048767584500297728\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n早稲田(@w_basketball )を応援🔥→「RT」\n大東文化を応援🔥→「いいね」\n\nこちらも注目の1戦ですね👀\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/9VE8yifWO6\",\"2018-10-07 02:50 +0000\",\"3400.0\",\"78.0\",\"0.022941176470588236\",\"6.0\",\"0.0\",\"3.0\",\"18.0\",\"8.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"392\",\"38\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767298532663296\",\"https://twitter.com/Playerapp_cbsk/status/1048767298532663296\",\"【#大学バスケ 注目試合👀】\n\n早稲田 VS 大東文化\n10/7(日)15:40 TIP OFF!\n\n現在首位の大東文化に早稲田がどう挑むか💨\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/zvmK0LT97J\",\"2018-10-07 02:49 +0000\",\"956.0\",\"22.0\",\"0.02301255230125523\",\"1.0\",\"0.0\",\"0.0\",\"3.0\",\"15.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048388500695875584\",\"https://twitter.com/Playerapp_cbsk/status/1048388500695875584\",\"【#大学バスケ 注目試合👀】\n\n法政 VS 明星\n10/6(土)12:00 TIP OFF!\n\n好調を保つ法政に対し、\n明星はどんな戦略で挑むか楽しみです✍️\n\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/H1qt6a2YHS\",\"2018-10-06 01:44 +0000\",\"663.0\",\"9.0\",\"0.013574660633484163\",\"0.0\",\"0.0\",\"0.0\",\"4.0\",\"2.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
Parseしたもの
"\"ツイートID\",\"ツイートの固定リンク\",\"ツイート本文\",\"時間\",\"インプレッション\",\"エンゲージメント\",\"エンゲージメント率\",\"リツイート\",\"返信\",\"いいね\",\"ユーザープロフィールクリック\",\"URLクリック数\",\"ハッシュタグクリック\",\"詳細クリック\",\"固定リンクのクリック数\",\"アプリ表示\",\"アプリインストール\",\"フォローしている\",\"ツイートをメール送信\",\"ダイアル式電話\",\"メディアの再生数\",\"メディアのエンゲージメント\",\"プロモのインプレッション\",\"プロモのエンゲージメント\",\"プロモのエンゲージメント率\",\"プロモのリツイート\",\"プロモの返信\",\"プロモのいいね\",\"プロモのユーザープロフィールクリック\",\"プロモのURLクリック数\",\"プロモのハッシュタグクリック\",\"プロモの詳細クリック\",\"プロモの固定リンクのクリック数\",\"プロモのアプリ表示\",\"プロモのアプリインストール\",\"プロモのフォローしている\",\"プロモのツイートをメール送信\",\"プロモのダイアル式電話\",\"プロモのメディアの再生数\",\"プロモのメディアのエンゲージメント\"\n\"1049656543589875712\",\"https://twitter.com/Playerapp_cbsk/status/1049656543589875712\",\"大学生の皆さんーー!!\n絶対楽しいのでぜひぜひ参加下さい😊 https://t.co/90pPlcUF2L\",\"2018-10-09 13:43 +0000\",\"1332.0\",\"4.0\",\"0.003003003003003003\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1049164532881358848\",\"https://twitter.com/Playerapp_cbsk/status/1049164532881358848\",\"おおー!!\n大学バスケでもやろうかなー需要あるかなーー😎\n\n#高校バスケ #ウインターカップ #大学バスケ https://t.co/snkoMweMAT\",\"2018-10-08 05:08 +0000\",\"1578.0\",\"6.0\",\"0.0038022813688212928\",\"1.0\",\"0.0\",\"2.0\",\"0.0\",\"0.0\",\"1.0\",\"2.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767660815609856\",\"https://twitter.com/Playerapp_cbsk/status/1048767660815609856\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n大東文化を応援🔥→「RT」\n早稲田(@w_basketball )を応援🔥→「いいね」\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/FWLsgTuy1I\",\"2018-10-07 02:51 +0000\",\"3276.0\",\"95.0\",\"0.028998778998779\",\"3.0\",\"0.0\",\"7.0\",\"13.0\",\"14.0\",\"0.0\",\"17.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"463\",\"41\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767584500297728\",\"https://twitter.com/Playerapp_cbsk/status/1048767584500297728\",\"🏀RT&いいねで #大学バスケ を盛り上げよう🏀\n\n早稲田(@w_basketball )を応援🔥→「RT」\n大東文化を応援🔥→「いいね」\n\nこちらも注目の1戦ですね👀\n\nPlayer!速報はこちら👇\nhttps://t.co/kAS3LIwvS4 https://t.co/9VE8yifWO6\",\"2018-10-07 02:50 +0000\",\"3400.0\",\"78.0\",\"0.022941176470588236\",\"6.0\",\"0.0\",\"3.0\",\"18.0\",\"8.0\",\"0.0\",\"5.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"392\",\"38\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048767298532663296\",\"https://twitter.com/Playerapp_cbsk/status/1048767298532663296\",\"【#大学バスケ 注目試合👀】\n\n早稲田 VS 大東文化\n10/7(日)15:40 TIP OFF!\n\n現在首位の大東文化に早稲田がどう挑むか💨\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/zvmK0LT97J\",\"2018-10-07 02:49 +0000\",\"956.0\",\"22.0\",\"0.02301255230125523\",\"1.0\",\"0.0\",\"0.0\",\"3.0\",\"15.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n\"1048388500695875584\",\"https://twitter.com/Playerapp_cbsk/status/1048388500695875584\",\"【#大学バスケ 注目試合👀】\n\n法政 VS 明星\n10/6(土)12:00 TIP OFF!\n\n好調を保つ法政に対し、\n明星はどんな戦略で挑むか楽しみです✍️\n\n試合前にぜひ両チームへの応援コメントを書き込んでみてください😊\n\nhttps://t.co/H1qt6a2YHS\",\"2018-10-06 01:44 +0000\",\"663.0\",\"9.0\",\"0.013574660633484163\",\"0.0\",\"0.0\",\"0.0\",\"4.0\",\"2.0\",\"0.0\",\"3.0\",\"0.0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\"\n"
@ladnack ターミナルに出ているものはこちらです。
@yusuko
HerokuでCollaboratorsにおれも追加しておいて
@yusuko Did you already see http://blog.livedoor.jp/sasata299/archives/51330773.html ?
Ruby の CSV ライブラリでパースするときには、ダブルクォートは "" とエスケープされていないといけない
OK! Thank you!
I'm checking now!
Did you already see http://blog.livedoor.jp/sasata299/archives/51330773.html ? Ruby の CSV ライブラリでパースするときには、ダブルクォートは "" とエスケープされていないといけない
No, I didn't. I try to do it.
問題が発覚。 そもそもログインができていなかった。
そのため、csvが取得できずに
.... が変数`csv`に代入されていた。 電話番号が必要とのことなので、確認中。 もしくはローカルにあるクッキー情報を、herokuに移すのもありか。ログインに電話番号が必要だったため、手動で一個一個入力していった。
csvが取得できる時とできない時がある。 そのため、ループ処理で10回までリクエストを送っているがそれでも取得できない時がある🤔
また、別途でSQL connection Errorが起きる。
Player_twiのデータ取得できていない件について。
Cookie#domain returns dot-less domain name now. Use Cookie#dot_domain if you need "." at the beginning.
/app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:524:in `rescue in query': HTTPClient::KeepAliveDisconnected: Broken pipe (HTTPClient::KeepAliveDisconnected)
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:514:in `query'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:177:in `query'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1242:in `do_get_block'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1019:in `block in do_request'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1138:in `rescue in protect_keep_alive_disconnected'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1131:in `protect_keep_alive_disconnected'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1014:in `do_request'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:1104:in `follow_redirect'
from /app/vendor/bundle/ruby/2.4.0/gems/httpclient-2.8.3/lib/httpclient.rb:854:in `request'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/http_command.rb:291:in `execute_once'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/http_command.rb:104:in `block (2 levels) in execute'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/http_command.rb:101:in `block in execute'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
from /app/vendor/bundle/ruby/2.4.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/http_command.rb:93:in `execute'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/base_service.rb:360:in `execute_or_queue_command'
from /app/vendor/bundle/ruby/2.4.0/gems/google-api-client-0.21.2/lib/google/apis/core/base_service.rb:252:in `http'
from /app/vendor/bundle/ruby/2.4.0/gems/google_drive-2.1.11/lib/google_drive/api_client_fetcher.rb:37:in `request_raw'
from /app/vendor/bundle/ruby/2.4.0/gems/google_drive-2.1.11/lib/google_drive/session.rb:576:in `block in request'
from /app/vendor/bundle/ruby/2.4.0/gems/google_drive-2.1.11/lib/google_drive/session.rb:575:in `loop'
from /app/vendor/bundle/ruby/2.4.0/gems/google_drive-2.1.11/lib/google_drive/session.rb:575:in `request'
from /app/vendor/bundle/ruby/2.4.0/gems/google_drive-2.1.11/lib/google_drive/worksheet.rb:413:in `save'
from /app/google_sheet_client.rb:22:in `write_in_spreadsheet'
from script.rb:16:in `block in <main>'
from script.rb:10:in `each'
from script.rb:10:in `<main>'
Player_twiのproductionで取れない原因 1.そもそもcsvの取得に失敗する時がある →ループ処理の変更
2.メモリ落ちでエラーの発生 Process running mem=547M(106.9%) Error R14 (Memory quota exceeded)
Player_twiの1アカウントでメモリ落ちするので、何かしらの対応が必須。
RAM(おそらく変数とかの記憶に使われる)の容量が足りていない。
@yusuko
https://github.com/ookamiinc/twitter-analytics-acquirer/issues/9#issuecomment-429600448
HerokuでCollaboratorsにおれも追加しておいて
🙏
I'm sorry for late reply! I added your account. Please check!
Thanks👍
heroku公式ドキュメント
gem "puma_worker_killer" を使うと、メモリが落ちてもリスタートする(??)
gemの容量 https://devcenter.heroku.com/articles/ruby-memory-use
Too much memory on boot A common cause of memory use is due to libraries being required in a Gemfile but not used. You can see how much memory your gems use at boot time through the derailed benchmark gem.
First add the gem to your Gemfile:
gem 'derailed', group: :development Now $ bundle install and you’re ready to investigate memory use. You can run:
$ bundle exec derailed bundle:mem This will output the memory use of each of your gems as they are required into memory:
$ derailed bundle:mem TOP: 54.1836 MiB mail: 18.9688 MiB mime/types: 17.4453 MiB mail/field: 0.4023 MiB mail/message: 0.3906 MiB action_view/view_paths: 0.4453 MiB action_view/base: 0.4336 MiB
twitter_analtics_acquirer
TOP: 46.668 MiB
google_drive: 22.4453 MiB
google_drive/session: 17.3906 MiB
google_drive/api_client_fetcher: 15.582 MiB
google/apis/drive_v3: 13.082 MiB
google/apis/drive_v3/service.rb: 9.3984 MiB
google/apis/core/base_service: 8.0039 MiB (Also required by: google/apis/drive_v3/classes.rb, google/apis/drive_v3/representations.rb)
google/apis/core/batch: 3.4688 MiB
google/apis/core/upload: 3.3672 MiB (Also required by: google/apis/core/composite_io, google/apis/core/base_service)
mime-types: 3.3086 MiB
mime/types: 3.3047 MiB (Also required by: mechanize/pluggable_parsers)
mime/types/registry: 3.0781 MiB
httpclient: 2.9648 MiB
httpclient/cookie: 2.0469 MiB
http-cookie: 2.0 MiB
http/cookie: 2.0 MiB (Also required by: http/cookie_jar, mechanize/cookie)
domain_name: 1.9336 MiB
domain_name/etld_data: 1.875 MiB
httpclient/session: 0.8203 MiB (Also required by: httpclient/auth)
httpclient/timeout: 0.7578 MiB
google/apis/core/api_command: 0.9063 MiB (Also required by: google/apis/core/upload, google/apis/core/download)
google/apis/core/http_command: 0.8477 MiB (Also required by: google/apis/core/batch, google/apis/core/upload)
addressable/template: 0.4336 MiB (Also required by: google/apis/core/api_command, google/apis/core/http_command)
google/apis/core/json_representation: 0.707 MiB (Also required by: google/apis/drive_v3/classes.rb, google/apis/drive_v3/representations.rb)
representable/json: 0.5898 MiB
representable/hash: 0.5547 MiB
representable: 0.5156 MiB (Also required by: representable/decorator)
google/apis/drive_v3/representations.rb: 3.1211 MiB
google/apis/drive_v3/classes.rb: 0.5195 MiB
net/https: 2.4492 MiB (Also required by: webrobots)
net/http: 2.4023 MiB (Also required by: net/http/digest_auth, net/http/persistent)
net/protocol: 0.8438 MiB
socket: 0.6563 MiB (Also required by: httpclient/session, ipaddr)
google_drive/spreadsheet: 1.1523 MiB (Also required by: google_drive/collection)
google_drive/worksheet: 0.8008 MiB (Also required by: google_drive/session)
google_drive/list: 0.4883 MiB
google_drive/list_row: 0.4219 MiB
googleauth: 5.043 MiB (Also required by: google_drive/session, google/apis/core/base_service)
googleauth/application_default: 3.332 MiB
googleauth/compute_engine: 2.7734 MiB
googleauth/signet: 2.1289 MiB (Also required by: googleauth/service_account, googleauth/user_refresh, and 3 others)
signet/oauth_2/client: 2.0977 MiB (Also required by: googleauth/credentials)
addressable/uri: 1.3516 MiB (Also required by: signet/errors, google/apis/core/base_service, and 8 others)
addressable/idna: 1.1094 MiB
addressable/idna/pure: 1.1094 MiB
jwt: 0.4766 MiB (Also required by: googleauth/service_account)
faraday: 0.4961 MiB (Also required by: signet/oauth_2/client)
googleauth/default_credentials: 0.5391 MiB (Also required by: googleauth)
googleauth/credentials: 1.3984 MiB
rails/all: 21.668 MiB
rails: 8.2617 MiB (Also required by: active_record/railtie, active_model/railtie, and 7 others)
rails/application: 3.1602 MiB
yaml: 2.0508 MiB (Also required by: active_support/encrypted_configuration, rails/secrets, and 4 others)
psych: 2.0391 MiB
psych/nodes: 0.7773 MiB
psych/nodes/alias: 0.375 MiB
psych/visitors: 0.6914 MiB
psych/visitors/yaml_tree: 0.3555 MiB
active_support/message_verifier: 0.3164 MiB (Also required by: active_support/message_encryptor)
active_support: 3.0469 MiB (Also required by: active_support/railtie, active_support/i18n_railtie, and 11 others)
active_support/logger: 1.8984 MiB
active_support/logger_silence: 1.793 MiB
concurrent: 1.7695 MiB (Also required by: sprockets/manifest)
concurrent/configuration: 0.5742 MiB (Also required by: concurrent/scheduled_task, concurrent/options, and 2 others)
concurrent/delay: 0.4219 MiB (Also required by: concurrent/utility/processor_counter, concurrent)
concurrent/executor/immediate_executor: 0.3477 MiB (Also required by: concurrent/configuration, concurrent/executors)
concurrent/atomics: 0.4375 MiB (Also required by: concurrent/executor/simple_executor_service)
concurrent/executors: 0.3438 MiB
active_support/dependencies/autoload: 1.0117 MiB (Also required by: rails, active_support/rails)
active_support/inflector/methods: 1.0078 MiB (Also required by: active_support/inflector, active_support/core_ext/string/inflections, and 3 others)
active_support/inflections: 0.9297 MiB (Also required by: active_support/inflector)
active_support/inflector/inflections: 0.8242 MiB (Also required by: active_support/inflector)
concurrent/map: 0.332 MiB (Also required by: i18n, active_support/notifications/fanout, and 6 others)
active_support/railtie: 1.7266 MiB
active_support/i18n_railtie: 1.6719 MiB
active_support/file_update_checker: 0.9453 MiB (Also required by: rails/application/configuration)
active_support/core_ext/time/calculations: 0.9219 MiB (Also required by: active_support/core_ext/time, active_support/core_ext/numeric/time)
active_support/core_ext/time/conversions: 0.5352 MiB (Also required by: active_support/core_ext/time, active_support/core_ext/date_time/conversions)
active_support/values/time_zone: 0.5234 MiB (Also required by: active_support/time_with_zone, active_support/core_ext/date_time/conversions)
tzinfo: 0.4531 MiB
rails/railtie/configuration: 0.7031 MiB (Also required by: rails/engine/configuration)
rails/configuration: 0.6914 MiB
active_support/core_ext/object: 0.5938 MiB
active_support/core_ext/object/conversions: 0.3047 MiB
active_record/railtie: 7.3203 MiB
action_controller/railtie: 4.8867 MiB (Also required by: rails/all, sprockets/railtie)
action_controller: 3.8359 MiB
action_controller/metal/strong_parameters: 1.8281 MiB
rack/test: 1.0156 MiB
rack/test/methods: 0.3945 MiB
action_controller/metal/live: 1.6875 MiB
action_dispatch/http/response: 1.5625 MiB
rack/response: 1.1094 MiB
rack/request: 0.8984 MiB (Also required by: action_dispatch/http/request)
rack/utils: 0.6602 MiB (Also required by: rack/response, sprockets/server, and 2 others)
action_view/railtie: 0.8711 MiB (Also required by: rails/all)
action_view: 0.7656 MiB (Also required by: sprockets/rails/helper)
active_support/core_ext/string/output_safety: 0.6328 MiB (Also required by: action_view/helpers/tag_helper, action_view/helpers/capture_helper, and 6 others)
erb: 0.3398 MiB (Also required by: sprockets/erb_processor, action_view/helpers/form_options_helper)
active_record: 2.3477 MiB (Also required by: active_storage)
arel: 0.9805 MiB
arel/visitors: 0.5703 MiB
arel/visitors/to_sql: 0.3945 MiB
arel/visitors/reduce: 0.3789 MiB
active_record/connection_adapters/abstract_adapter: 0.9063 MiB
sprockets/railtie: 4.4688 MiB
sprockets/rails/context: 2.1992 MiB
action_view/helpers: 2.1875 MiB
action_view/helpers/form_helper: 1.5703 MiB (Also required by: action_view/helpers/form_options_helper)
action_view/helpers/form_tag_helper: 1.3203 MiB
action_view/helpers/text_helper: 1.2188 MiB
action_view/helpers/sanitize_helper: 1.1953 MiB
rails-html-sanitizer: 1.1836 MiB
loofah: 1.125 MiB
nokogiri: 1.0078 MiB (Also required by: google_drive/session, mechanize)
nokogiri/xml: 0.3711 MiB
nokogiri/html: 0.3047 MiB
sprockets: 1.5195 MiB (Also required by: sprockets/rails/context, sprockets/rails/helper)
sprockets/environment: 0.8867 MiB
sprockets/base: 0.8359 MiB (Also required by: sprockets/cached_environment, sprockets/legacy)
sprockets/configuration: 0.543 MiB (Also required by: sprockets)
rails/application/configuration: 0.582 MiB
active_storage/engine: 1.1797 MiB
action_dispatch/routing/route_set: 1.0039 MiB
action_dispatch/journey: 0.5352 MiB
action_dispatch/journey/router: 0.4375 MiB
mechanize: 1.793 MiB
mechanize/http/agent: 0.5195 MiB
mechanize/form: 0.4883 MiB
mysql2: 0.7148 MiB
mysql2/mysql2: 0.5977 MiB
railsの使用量が多いので、日付をrubyに書き換える
rails gemを削除した後の使用量(約半分に)
TOP: 28.7656 MiB
google_drive: 24.4648 MiB
google_drive/session: 18.2656 MiB
google_drive/api_client_fetcher: 14.4023 MiB
google/apis/drive_v3: 13.6563 MiB
google/apis/drive_v3/service.rb: 9.5977 MiB
google/apis/core/base_service: 8.8516 MiB (Also required by: google/apis/drive_v3/classes.rb, google/apis/drive_v3/representations.rb)
google/apis/core/batch: 6.0859 MiB
google/apis/core/upload: 6.0195 MiB (Also required by: google/apis/core/composite_io, google/apis/core/base_service)
mime-types: 5.9961 MiB
mime/types: 5.9961 MiB (Also required by: mechanize/pluggable_parsers)
mime/types/registry: 5.8203 MiB
httpclient: 2.2773 MiB
httpclient/cookie: 1.5781 MiB
http-cookie: 1.4453 MiB
http/cookie: 1.4375 MiB (Also required by: http/cookie_jar, mechanize/cookie)
domain_name: 1.3867 MiB
domain_name/etld_data: 1.2109 MiB
google/apis/core/api_command: 0.375 MiB (Also required by: google/apis/core/upload, google/apis/core/download)
google/apis/core/http_command: 0.3672 MiB (Also required by: google/apis/core/batch, google/apis/core/upload)
google/apis/core/json_representation: 0.6445 MiB (Also required by: google/apis/drive_v3/classes.rb, google/apis/drive_v3/representations.rb)
representable/json: 0.5273 MiB
representable/hash: 0.4883 MiB
representable: 0.4688 MiB (Also required by: representable/decorator)
google/apis/drive_v3/representations.rb: 3.4375 MiB
google/apis/drive_v3/classes.rb: 0.6055 MiB
net/https: 0.7344 MiB (Also required by: webrobots)
net/http: 0.7305 MiB (Also required by: net/http/digest_auth, net/http/persistent)
net/protocol: 0.3633 MiB
socket: 0.3164 MiB (Also required by: httpclient/session, ipaddr)
nokogiri: 2.1484 MiB (Also required by: mechanize, webrobots/nokogiri)
nokogiri/xml: 0.9219 MiB
nokogiri/version: 0.3945 MiB
nokogiri/html: 0.3672 MiB
google_drive/spreadsheet: 1.2109 MiB (Also required by: google_drive/collection)
google_drive/worksheet: 0.8281 MiB (Also required by: google_drive/session)
google_drive/list: 0.4922 MiB
google_drive/list_row: 0.3984 MiB
googleauth: 5.9922 MiB (Also required by: google_drive/session, google/apis/core/base_service)
googleauth/application_default: 5.707 MiB
googleauth/compute_engine: 4.0781 MiB
googleauth/signet: 3.5547 MiB (Also required by: googleauth/service_account, googleauth/user_refresh, and 3 others)
signet/oauth_2/client: 3.5313 MiB (Also required by: googleauth/credentials)
addressable/uri: 2.2031 MiB (Also required by: signet/errors, google/apis/core/base_service, and 8 others)
addressable/idna: 1.7383 MiB
addressable/idna/pure: 1.7305 MiB
jwt: 0.6016 MiB (Also required by: googleauth/service_account)
signet/oauth_2: 0.3711 MiB
faraday: 0.3438 MiB (Also required by: signet/oauth_2/client)
googleauth/default_credentials: 1.6289 MiB (Also required by: googleauth)
googleauth/credentials_loader: 1.4688 MiB (Also required by: googleauth/service_account, googleauth/user_refresh, and 3 others)
os: 1.3789 MiB
yaml: 1.2344 MiB (Also required by: http/cookie_jar/yaml_saver)
psych: 1.1992 MiB
psych/nodes: 0.6719 MiB
psych/nodes/node: 0.3477 MiB
mechanize: 3.5039 MiB
mechanize/http/agent: 1.875 MiB
net/ntlm: 1.4727 MiB
mechanize/form: 0.4492 MiB
mysql2: 0.7422 MiB
mysql2/mysql2: 0.6016 MiB
問題は二つあり
現状上手くとれていないアカウント
Playerapp_yakyu
Player_twi
その他は、at most 250とか。
ツイート数が多すぎると、csvデータがとれなくなるのかもしれない。(仮説)
上記はPlayerapp_yakyuuのもの。 24requests export_urlは、分割してデータ取得している??そのため、回数を送る必要がある??
Player_twiは1回で取得できたので、どうやら違うみたい。
デバッグの流れの整理
大まかに2つの問題があった。 1.Player_twiにて、そもそもcsvのデータがとれないcaseの多発(他のアカウントではほぼ起きない)
そのため下記の対処をした。 まず2への対処から行った。
Process running mem=547M(106.9%)
Error R14 (Memory quota exceeded)
が2のエラー原因だと発覚。https://github.com/ookamiinc/twitter-analytics-acquirer/issues/9#issuecomment-431942901
現在2のエラーが起きるかどうかについて検証中だが、そこで1の問題が浮上。 今度は全くcsvがとれなくなった。
現在はローカルでも取得できていない。 →であれば、いつまで戻れば取得できるのか試す。(まだとれてない。。。)
@nafu @ladnack Twitterのシステム、ちょっと原因がわからなすぎるので、水曜日か木曜日に対面で相談させてもらうかもです。。。 現状はmasterにpushしているものでherokuも動いています。
hopefully, 水曜日までにはなんとか直します。
現状の説明を分かりやすくまとめておいてもらえると🙏 同じ作業をせずにより素早く解決へ向かえると思います
ありがとうございます! まとめます!
プロセス中に主に2つの問題があった。
「スクレイピングで取得 (csv)」ができていない時がある
「取得したデータをスプレッドシートに書き込む」ときにメモリ落ちが発生する(下記エラーメッセージ )
Process running mem=547M(106.9%)
Error R14 (Memory quota exceeded)
1の解決策は現状見つかっていない。 2の解決策は、gemを減らしたこと。rails gemを削った。ただし、2の効果を検証する段階で(2のエラーを検証するためには、Player_twiのcsv取得に成功した上で、書き込むときにエラーが出ないかを知る必要があった)、1のエラーを回避できなくなり、まだ2の効果を検証できていない。
1の解決策は現状見つかっていない。
の場合のエラーメッセージは分かる? @yusuko
def get_analytics_data
return if @agent.nil?
for i in 1..20 do
@agent.post(export_url)
break if @agent.post(export_url).body.include?("Available")
sleep(5)
end
for i in 1..10 do
res = @agent.get(bundle_url)
puts 'nil!!' if res.body.empty?
break unless res.body.empty?
end
res.body.force_encoding('utf-8')
end
色々変更して見にくいのですが、上記プロセスでcsvを取得しています。
csvの取得に失敗した時は、エラーではなく、""
がres.bodyに返ってくるので、エラーメッセージ は出ません。
[Q] @agentのログ取れない? @yusuko
それと追記して、11月のPlayer_twiは今日の朝9:30の自動運用で取れていました。 そのため、データ容量が多いと取得失敗するのではないかと仮説立てています。
https://github.com/ookamiinc/twitter-analytics-acquirer/issues/9#issuecomment-433866309
[Q] putsとかで出力させるということでしょうか?それであれば可能です!
ので追加してpushします。
herokuのcollaboratorにふーみんさんも追加しておきます。(もし見たいときあれば)
(byebug) @agent.post(export_url)
失敗する時は、@bodyのstatutsがpendingになります。
(byebug) @agent.post(export_url)
取得成功の時は、@bodyのstatutsがavairableになります。
10月末のPlayer_twiは常にstatusがpendingだったと推測しています。(byebugでやった時は常にpendingだったため。)
puts
Logger使ったほうが好ましいよ
ありがとうございます! デバッグの方法、調べます💪
D, [2018-11-02T10:31:43.460381 #5] DEBUG -- : #<Mechanize:0x00000000023f7be8 @agent=#<Mechanize::HTTP::Agent:0x00000000023f7af8 @allowed_error_codes=[], @conditional_requests=true, @context=#<Mechanize:0x00000000023f7be8 ...>, @content_encoding_hooks=[], @cookie_jar=#<Mechanize::CookieJar:0x00000000023f7a80 @store=#<HTTP::CookieJar::HashStore:0x0000000002487bf8 @mon_owner=nil, @mon_count=0, @mon_mutex=#
上記が一番上の@agent
def get_analytics_data
return if @agent.nil?
logger = Logger.new(STDERR)
logger.debug(@agent.inspect)
for i in 1..20 do
@agent.post(export_url)
break if @agent.post(export_url).body.include?("Available")
sleep(5)
end
logger.debug(@agent.inspect)
for i in 1..10 do
res = @agent.get(bundle_url)
puts 'nil!!' if res.body.empty?
break unless res.body.empty?
end
logger.debug(@agent.inspect)
res.body.force_encoding('utf-8')
end
8つのアカウントで取得できない原因は2つあった。
csvの取得
export_url
にリクエストを送る必要があった。csvのスプレッドシートへの書き込み
上記によって、10月データの取得の成功。11/19~11/20の6回で自動取得もエラーなく成功した。
What
扱うアカウントを 1→8にする。
To do
[x] worksheetnameの変更
[x] DBにデータ挿入(local) 確認
[x] DBにデータ挿入(production) 確認
Summary
8つのアカウントで取得できない原因は2つあった。
csvの取得
export_url
にリクエストを送る必要があった。csvのスプレッドシートへの書き込み
上記によって、10月データの取得の成功。11/19~11/20の6回で自動取得もエラーなく成功した。