![]() |
Parsing JSON - Finding element paths
I've gotten some help with working with my JSON replies... however im having alot of troubles determining the right path to elements of the reply. Is there a simplier way or perhaps a software that will better layout the JSON reply so i can see the objects more clearly?
For example, I'm getting a JSON reply from the youtube API and im trying to get the path to the first video in the list of 3 ive requested... i think it's something like this... title = base.entry[0].title link = base.entry[0].link[0].href thumbnail = base.entry[0].media$thumbnail[0].url info = base.entry[0].media$description.$t am i in the right ballpark on these refrences? the JSON reply can be pulled up here as it appears to be to long to paste into a code bracket https://gdata.youtube.com/feeds/api/...3&v=2&alt=json |
you can plug that url in here which makes it a bit more humanly readable
|
looking at it, I think the last two would be better one level deeper, into the media$group object, like this:
Code:
var thumbnail = base.entry[0].media$group.media$thumbnail[0].url; |
Quote:
Wrote the callback and function and i was dead on using the link you gave me! If your interested at all or anyone out there would like some youtue API reference material here is the results Callback: Code:
<script Code:
function showMyVideos(data) |
| All times are GMT +1. The time now is 02:43 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.