虽然迭代使用ASP的Xtreme演化为JSON回报 [英] Iterating though a JSON return using ASP Xtreme Evolution
问题描述
我试图解析从Twitter使用传统的ASP与ASP的Xtreme演进JSON解析器回报
<一href=\"https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp\" rel=\"nofollow\">https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp
I'm trying to parse a return from Twitter using classic ASP with ASP Xtreme Evolution JSON Parser https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp
为了简单起见,这里有一个修整JSON回报:
To keep things simple, here's a trimmed JSON return:
[{
"user": {
"id": 19720970
}
}, {
"user": {
"id": 201195798
}
}, {
"user": {
"id": 19768935
}
}]
我需要做的是通过每个用户
迭代来发现 ID
。
我已经得到了最好到目前为止只返回最后一个 ID
:
dim Info : set Info = JSON.parse(join(array(jsonResponse)))
dim key : For Each key in Info.user.keys()
Response.Write Info.user.id & "<br>" 'only 19768935 is printed
Next
set Info = nothing
没有人有任何想法如何retireve每个 ID
?
第二个查询(但不紧急的)是,我只能得到这个分析如果我删除外围方括号。这是为什么,是有办法与他们解析它?
A second query (but less urgent) is that I can only get this to parse if I remove the outlying square brackets. Why is this and is there a way to parse it with them in?
非常感谢
贾斯汀
Many thanks Justin
推荐答案
感谢所有那些谁已经采取看看这个问题。
Thanks to all those who have taken a look at this problem.
尝试了一些事情,包括格式化动态响应后,我发现相当简单的回答我的问题:
After trying a number of things including reformatting the response on the fly, I've found the rather simple answer to my problem:
For Each key in Info.keys()
Response.Write Info.get(key).user.id & "<br />"
Next
希望帮助在未来的人: - )
Hope that helps anyone in the future :-)
这篇关于虽然迭代使用ASP的Xtreme演化为JSON回报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!