を、あなたのデータは次のようになります。
{
"kind": "Listing",
"data": {
"modhash": "fop7jgfq8z07efe8b23281496fdcd30eae5038b50d6b9811d2",
"children": [{
"kind": "t3",
"data": {
"contest_mode": false,
"subreddit_name_prefixed": "r/reddevils",
"banned_by": null,
"media_embed": {},
"thumbnail_width": 140,
"subreddit": "reddevils",
"selftext_html": null,
"selftext": "",
"likes": null,
"suggested_sort": null,
"user_reports": [],
"secure_media": null,
"link_flair_text": "TIER 0",
"id": "6jqxwx",
"view_count": null,
"secure_media_embed": {},
"clicked": false,
"report_reasons": null,
"author": "SuperShadowJr",
"saved": false,
"mod_reports": [],
"name": "t3_6jqxwx",
"score": 792,
"approved_by": null,
"over_18": false,
"domain": "instagram.com",
"hidden": false,
"preview": {
"images": [{
"source": {
"url": "https://i.redditmedia.com/qKDgoT2EDbwYbozYQO23nDisAj6yd9I2XwdWKLw-QNQ.jpg?s=5fe73832273b3e88324a6da17fa55fae",
"width": 640,
"height": 640
},
"resolutions": [{
"url": "https://i.redditmedia.com/qKDgoT2EDbwYbozYQO23nDisAj6yd9I2XwdWKLw-QNQ.jpg?fit=crop&crop=faces%2Centropy&arh=2&w=108&s=b668298ccd3a69304ab23c5aef1b6d77",
"width": 108,
"height": 108
}, {
"url": "https://i.redditmedia.com/qKDgoT2EDbwYbozYQO23nDisAj6yd9I2XwdWKLw-QNQ.jpg?fit=crop&crop=faces%2Centropy&arh=2&w=216&s=706a70a275e20973e8ce772f362db87f",
"width": 216,
"height": 216
}, {
"url": "https://i.redditmedia.com/qKDgoT2EDbwYbozYQO23nDisAj6yd9I2XwdWKLw-QNQ.jpg?fit=crop&crop=faces%2Centropy&arh=2&w=320&s=42c33880cf1a0a1c14e814de5469a1a1",
"width": 320,
"height": 320
}, {
"url": "https://i.redditmedia.com/qKDgoT2EDbwYbozYQO23nDisAj6yd9I2XwdWKLw-QNQ.jpg?fit=crop&crop=faces%2Centropy&arh=2&w=640&s=783b2011d7523d9c84450293eef9d6c0",
"width": 640,
"height": 640
}],
"variants": {},
"id": "TNO0lZhaqwUX-vbTYG6y0bI6hZhhgQJWTgm_OVk7b2E"
}],
"enabled": false
},
"thumbnail": "https://a.thumbs.redditmedia.com/8U2J6sELZ1AIGDsReUz-v10X3qyFG49TBH0XrjXAMc8.jpg",
"subreddit_id": "t5_2rxse",
"edited": false,
"link_flair_css_class": "black",
"author_flair_css_class": null,
"gilded": 0,
"downs": 0,
"brand_safe": true,
"archived": false,
"removal_reason": null,
"post_hint": "link",
"can_gild": true,
"thumbnail_height": 140,
"hide_score": false,
"spoiler": false,
"permalink": "/r/reddevils/comments/6jqxwx/fabinhos_girlfriendwife_likes_ig_picture_of/",
"num_reports": null,
"locked": false,
"stickied": false,
"created": 1498574067.0,
"url": "https://www.instagram.com/p/BV0dLySgy82/",
"author_flair_text": null,
"quarantine": false,
"title": "Fabinho's girlfriend/wife likes IG picture of Fabinho in MUFC kit with the caption \"Could we see this man in the PL?\"",
"created_utc": 1498545267.0,
"distinguished": null,
"media": null,
"num_comments": 79,
"is_self": false,
"visited": false,
"subreddit_type": "public",
"is_video": false,
"ups": 792
}
}],
"after": "t3_6jqxwx",
"before": null
}
}
だから、あなたは使用することができます。
redditResponse.data.children[0].data.permalink
の作業のデモ:https://jsfiddle.net/jfriend00/nkpchrk0/
あなたはすべての子どもが欲しい場合は、中i
を反復処理する必要があります。一つ一つを取得するために
redditResponse.data.children[i].data.permalink
。
それとも、自分自身の配列に一度にすべてを取得するには、あなたがこれを行うことができます:
let permaLinks = redditResponse.data.children.map(function(child) {
return child.data.permalink;
});
をFYI、NPMの 'request'パッケージは、httpはNode.jsの中に少し単純要請ます。それはあなたのための全体の要求を取得するので、あなたは一緒にすべてのチャンクを収集する必要はありません。 – jfriend00