{"id":23918007,"url":"https://github.com/hideack/health_data_summary","last_synced_at":"2025-10-25T02:28:07.695Z","repository":{"id":270932710,"uuid":"911890927","full_name":"hideack/health_data_summary","owner":"hideack","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-04T05:43:05.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T06:26:56.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hideack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-04T05:38:39.000Z","updated_at":"2025-01-04T05:43:08.000Z","dependencies_parsed_at":"2025-01-04T06:26:58.597Z","dependency_job_id":"86cf7333-4125-4870-9e66-d9e403db57fc","html_url":"https://github.com/hideack/health_data_summary","commit_stats":null,"previous_names":["hideack/health_data_summary"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hideack%2Fhealth_data_summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hideack%2Fhealth_data_summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hideack%2Fhealth_data_summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hideack%2Fhealth_data_summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hideack","download_url":"https://codeload.github.com/hideack/health_data_summary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371755,"owners_count":19790888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-05T13:12:08.592Z","updated_at":"2025-10-25T02:28:02.654Z","avatar_url":"https://github.com/hideack.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPXファイル解析スクリプト\n\nこのスクリプトは、指定した年のGPXファイルを解析し、年間の運動記録を以下の指標で出力します：\n\n- **運動日数**: 指定年に運動を行った日数\n- **年間累計移動距離**: 運動による総移動距離 (km 単位)\n- **年間累計運動時間**: 運動に費やした総時間 (時間単位)\n\n## 必要要件\n\n- **Ruby 3.x**\n- **nokogiri** ライブラリ\n\n  Nokogiriがインストールされていない場合は以下のコマンドでインストールしてください：\n  ```bash\n  gem install nokogiri\n  ```\n\n## 使用方法\n\n1. **GPXファイルの準備**\n   - `workout-routes`ディレクトリ内に`route_YYYY-MM-DD_HH.mm(am|pm).gpx`形式のファイルを配置してください。\n   - ファイル名の例：\n     - `route_2024-01-02_7.46am.gpx`\n     - `route_2024-12-31_9.31am.gpx`\n\n2. **スクリプトの実行**\n   以下のコマンドでスクリプトを実行します：\n\n   ```bash\n   ruby health_data_summary.rb --year 2024\n   ```\n\n3. **出力結果**\n   スクリプトは指定年の運動記録を以下の形式で出力します：\n\n   ```\n   Results for the year 2024:\n   運動日数: 150\n   年間累計移動距離: 871.24 km\n   年間累計運動時間: 120.45 hours\n   ```\n\n## ファイル構造の例\n\n以下はスクリプトが期待するディレクトリ構造の例です：\n\n```\n.\n├── health_data_summary.rb\n├── workout-routes/\n│   ├── route_2024-01-02_7.46am.gpx\n│   ├── route_2024-12-31_9.31am.gpx\n│   └── ...\n```\n\n## スクリプトの仕組み\n\n1. `workout-routes`ディレクトリ内のGPXファイルを走査し、指定した年のファイルを抽出します。\n2. 各GPXファイル内のトラックポイント (`\u003ctrkpt\u003e`) を解析し、以下を計算します：\n   - トラックポイント間の移動距離（ハバースインの公式を使用）\n   - トラックポイント間の経過時間\n3. 結果を集計し、運動日数、総移動距離、総運動時間を出力します。\n\n## 注意事項\n\n- GPXファイルは`\u003ctrkpt\u003e`要素を含む必要があります。\n- ディレクトリ名およびファイル名の形式を正しく指定してください。\n- 緯度・経度が不正確な場合、計算結果が正確でない可能性があります。\n\n## 問題が発生した場合\n\n- GPXファイルの形式や内容を確認してください。\n- 必要に応じて`health_data_summary.rb`内のデバッグログを有効にし、詳細な処理状況を確認してください。\n\n## ライセンス\n\nこのスクリプトは自由に利用・改変可能です。ただし、使用に際して発生した問題については責任を負いません。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhideack%2Fhealth_data_summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhideack%2Fhealth_data_summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhideack%2Fhealth_data_summary/lists"}