at my company we often use stock photo's from thinkstock.com.. Now my boss would have liked it if we labeled all our stock images so we could store them on our server for later use (so we don't need to download images 2-3 times) but Thinkstock images don't come with iptc data filled in.. and because we only have 1 pc that has access to our thinkstock account I was wondering if it was possible to automate this to be able to work on our other pc without the account..
I figured out how to get the Keywords list from thinkstock.com using this code
// Create a URL for the desired page URL url = new URL("http://www.thinkstock.com/image/106407848"); boolean opslaan = false; String[] Keyword; String KeywordList = ""; // Read all the text returned by the server BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String str; while ((str = in.readLine()) != null) { if (str.contains("keywordlist")){ opslaan = true; } if (str.contains("</div>")){ opslaan = false; } if(opslaan == true){ Keyword = str.split("\\|"); for(int i =0; i < Keyword.length ; i++){ if(i == 1){ if(KeywordList == ""){ KeywordList += Keyword[i];} else{ KeywordList += ", " + Keyword[i]; } } } } } System.out.println(KeywordList); in.close();
this outputs the list of keywords to the console of the image "106407848" (being "2-3 Years, 4-5 Years, Beautiful People, Beauty, Blond Hair, blablabla").. I can also figure out how to make this work for images stored in a specific folder on the server.. no problem there.. but I can't find anything on writing this string to the IPTC-field "Description" like you see in Photoshop or Bridge when you go to file info.. I found how to get to it with Photoshop scripting but that doesn't allow all the other code where you get the string from the site.. when I googled my problem I found imagero and apache packages but I don't have a clue how to use them..
thanks in advance
anyone who can help me out?