test.json
Pocket API からの応答として受け取った以下を考えると、
{
"complete": 1,
"error": null,
"list": {
"1000055792": {
"excerpt": "Some Text",
"favorite": "0",
"given_title": "Some Title",
"given_url": "Some URL",
"has_image": "0",
"has_video": "0",
"is_article": "1",
"is_index": "0",
"item_id": "1000055792",
"resolved_id": "1000055792",
"resolved_title": "Title",
"resolved_url": "Some URL",
"sort_id": 700,
"status": "1",
"time_added": "1438646514",
"time_favorited": "0",
"time_read": "1439025088",
"time_updated": "1439025090",
"word_count": "10549"
},
"1000102810": {
"excerpt": "Some Text",
"favorite": "0",
"given_title": "Title",
"given_url": "Some URL",
"has_image": "1",
"has_video": "0",
"is_article": "1",
"is_index": "0",
"item_id": "1000102810",
"resolved_id": "1000102810",
"resolved_title": "Title",
"resolved_url": "Resolved URL",
"sort_id": 650,
"status": "1",
"time_added": "1440303789",
"time_favorited": "0",
"time_read": "1440320729",
"time_updated": "1440320731",
"word_count": "3219"
}
resolved_title
や などのキーの値にアクセスするにはどうすればよいですかword_count
。id
それらは、それ自体が 内にネストされている と同じように、数値であるオブジェクト内にネストされていlist
ます。jqを使用してネストされたオブジェクトにアクセスする方法を検索して見つけました。しかし、メイン オブジェクト内の別のオブジェクト内にネストされている値にアクセスするにはどうすればよいlist
でしょうか?
また、ID が異なり、連続していないため、再帰は可能ではないと思いますが、間違っている可能性があります。resolved_title
このデータを使用して、各項目のとのword_count
値のみを抽出し、それらを 2 列のスプレッドシートに保存するつもりです。
前もって感謝します!