I am struggling at transfering this code from JQuery to Java:
var url = 'http://gdata.youtube.com/feeds/api/videos/';
$.getJSON( url + '?v=2&alt=json-in-script&callback=?', {
'q': q,
}, function(data) {gotData(q, data);});
function gotData(q, data){
for(var i in data.feed.entry){
// print the data...
}
}
It calls a YouTube API and reads some of the JSON result fields.
What is the easiest and most proper way to implement this in Java? Since I need it for just one API method call, I need the lightest possible solution. But I am guessing the code will become much more complex in Java, whatever library I used.
Also, I don't want to use YouTube API client for Java, but some general REST-JSON solution instead, which I could use for a few more API-s in future.