YUI().use('node', 'yql', function(Y) { var res = Y.one('#res'), count = 0, url = ''; var q = Y.YQL('select * from flickr.photos.recent where (api_key = "1895311ec0d2e23431a6407f3e8dffcc")', { //Tell JSONP to not cache this request so we get new images on each request allowCache: false, on: { success: function(r) { count++; res.setHTML('

Recent Flickr Photos (query #' + count + ')

'); Y.each(r.query.results.photo, function(v) { res.append(Y.Lang.sub(url, v)); }); }, failure: function() { res.setHTML('YQL is down at the moment. Please try this example with mocked data.'); } } }); Y.later(8000, q, q.send, null, true); });