String apiCall = "http://api.flickr.com/services/rest/?method=flickr.tags.getClusterPhotos&"; String apiKey = "bd7435660785b923332b224789d33c93"; // REALLY YOU SHOULD REGISTER FOR ONE ONLINE String tagString="monkey"; PImage[] images; int imageIndex; void setup() { size(500, 500); String query = apiCall+"tag="+tagString+"&cluster_id=1&format=rest&extras=url_o&api_key="+apiKey; XMLElement xml = new XMLElement(this, query); XMLElement[] photoTag = xml.getChildren("photos/photo"); println(photoTag.length + " images"); images = new PImage[photoTag.length]; for (int i = 0; i < photoTag.length; i++) { String farm = photoTag[i].getString("farm"); String server = photoTag[i].getString("server"); String id = photoTag[i].getString("id"); String secret = photoTag[i].getString("secret"); String img = "http://farm"+farm+".static.flickr.com/"+server+"/"+id+"_"+secret+".jpg"; images[i] = requestImage(img); } textAlign(CENTER, CENTER); smooth(); } void draw() { background(0); if (images[imageIndex] != null) { image(images[imageIndex], 0, 0); } fill(0); ellipse(15,15,20,20); fill(255); text(imageIndex, 16, 14); if (frameCount % 60 == 0) { imageIndex++; if (imageIndex >= images.length) { imageIndex = 0; } } }