我想使用Flickr
Java API(flickrj)在Flickr中下载一组特定用户的照片
有人知道怎么做吗?
我用这段代码说过:
Transport t = new REST(); Flickr f = new Flickr(key,secret,t); User u = f.getPeopleInterface().findByUsername("username");
接下来我该怎么办?
解决方法
在有人能帮助我之前我找到了答案.
这是代码:
Transport t = new REST(); Flickr f = new Flickr("key","secret",t); PhotoList list = f.getPhotosetsInterface().getPhotos("setId",100,1); for (Iterator iterator = list.iterator(); iterator.hasNext();) { Photo photo = (Photo) iterator.next(); File file = new File("/tmp/" + photo.getId() + ".jpg"); ByteArrayOutputStream b = new ByteArrayOutputStream(); b.write(photo.getOriginalAsStream()); FileUtils.writeByteArrayToFile(file,b.toByteArray()); }