Question : Coldfusion - Json Data Output

Hi Folks,

This is, I'm sure, supposed to be an easy one, but for the life of me I can't figure it out.  Have spent a few hours going through various online resources without success.

Here's what I'm trying to do - grab the Twitter Trends via a cfhttp and output them to a list.  I can successfully grab the Json and Deserialize it, however I keep hitting a block when it comes to the output.

I've pasted my existing code below, any help to put me in the right direction would be much appreciated!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
<cfhttp url="http://api.twitter.com/1/trends/current.json"></cfhttp>
<cfset trends = deserializeJSON(cfhttp.FileContent)>

<cfdump var="#trends#">

<cfoutput>
    <cfloop from="1" to="#arrayLen(trends)#" index="i">
    	<a href="" class="bold">#trends.name[i]#</a><br />
    </cfloop>
</cfoutput>

Answer : Coldfusion - Json Data Output

Check this:

<cfhttp url="http://api.twitter.com/1/trends/current.json"></cfhttp>
<cfset current = deserializeJSON(cfhttp.FileContent)>
<cfset trendsName=StructKeyArray(current.trends) >
<cfset trends=current.trends[trendsName[1]] >


<cfoutput>
    <cfloop from="1" to="#arrayLen(trends)#" index="i">
          <a href="" class="bold">#trends[i].name#</a><br />
    </cfloop>
</cfoutput>

Random Solutions  
 
programming4us programming4us