我正在尝试遍历原子树以获取特定的项目值:
[
{"@":{"rel":"mentioned",
"ostatus:object-type":"http://activitystrea.ms/schema/1.0/collection",
"href":"http://activityschema.org/collection/public"}},
{"@":{"rel":"enclosure",
"type":"image/jpeg",
"length":"225009",
"href":"https://framapiaf.org/system/media_attachments/files/000/701/279/original/19ed3ec381293bd8.jpg"}},
{"@":{"rel":"enclosure",
"type":"image/jpeg",
"length":"180205",
"href":"https://framapiaf.org/system/media_attachments/files/000/701/280/original/101ec4084b0b1920.jpeg"}},
{"@":{"rel":"enclosure",
"type":"image/jpeg",
"length":"257325",
"href":"https://framapiaf.org/system/media_attachments/files/000/701/281/original/dff3d3dc2e8e1b89.jpg"}},
{"@":{"rel":"enclosure",
"type":"image/jpeg",
"length":"224565",
"href":"https://framapiaf.org/system/media_attachments/files/000/701/282/original/983f3ad336ebc721.jpg"}},
{"@":{"rel":"alternate",
"type":"text/html",
"href":"https://mastodon.art/@luka/99809176628976105"}}
]
(这是JSON.stringify(item['activity:object'].link)
)
但我似乎无法超越那些“@
”键;如何访问第一个@.type
和@.href
?