Skip to content

Instantly share code, notes, and snippets.

@kitschpatrol
Created March 26, 2012 17:46
Show Gist options
  • Save kitschpatrol/2207459 to your computer and use it in GitHub Desktop.
Save kitschpatrol/2207459 to your computer and use it in GitHub Desktop.
Adding Tags to the Processing Flickr Uploader
void mousePressed() {
// Upload the current camera frame.
println("Uploading");
// First compress it as a jpeg.
byte[] compressedImage = compressImage(cam);
// Create an ArrayList (which implements Collection) to hold tags
ArrayList tags = new ArrayList();
// Add as many tags as you like to the tags ArrayList
tags.add("cosmic");
tags.add("manifold");
// Set some meta data.
UploadMetaData uploadMetaData = new UploadMetaData();
uploadMetaData.setTitle("Frame " + frameCount + " Uploaded from Processing");
uploadMetaData.setTags(tags); // Pass in the tags!
uploadMetaData.setDescription("To find out how, go to http://frontiernerds.com/upload-to-flickr-from-processing");
uploadMetaData.setPublicFlag(true);
// Finally, upload/
try {
uploader.upload(compressedImage, uploadMetaData);
}
catch (Exception e) {
println("Upload failed");
}
println("Finished uploading");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment