Flickr4Java icon indicating copy to clipboard operation
Flickr4Java copied to clipboard

Flickr: Add JSon Output

Open callmeal opened this issue 13 years ago • 3 comments

... add JSon Response

callmeal avatar Jan 12 '12 23:01 callmeal

Am taking this out of the milestone as no work has been done on it and I'm a bit unclear on the intent of it. Was the intention to replace the XML response parsing with JSON instead?

boncey avatar Aug 20 '13 08:08 boncey

Actually i would like to have such functionality. The way how i understand it: Give access to json response (instead of marshalizing into java objects like Photo or Photoset). To use flickr4java as kind of proxy. This way one could prepare json on server side which then could be passed to client via AJAX. Such usage would avoid to expose API_key and API_secret on client side (if for some reasons it is required to fetch final data on the client).

I've already implemented a first working solution on a forked branch: 2 methods on on com.flickr4java.flickr.photos.PhotosInterface#PhotosInterface

  • public StringBuilder getInfoAsJson(String photoId, String secret, boolean noJsonCallback) throws FlickrException
  • public StringBuilder getSizesAsJson(String photoId, boolean noJsonCallback) throws FlickrException

1 method on on com.flickr4java.flickr.Transport

  • public abstract JSONResponse getJson(String path, Map<String, Object> parameters, String apiKey, String sharedSecret,boolean noJsonCallback) throws FlickrException;

(& interface and impl. for JSONResponse)

=> on forked branch https://github.com/Watcher24/Flickr4Java.git.

Let me know whether something like that could be added to the master branch somewhen. Or how i should implement it different ... whatever. Would be nice to get a feedback. thnx in advance, Christoph

Watcher24 avatar Oct 13 '14 00:10 Watcher24

Hi

I've added a pull request (https://github.com/callmeal/Flickr4Java/pull/112) which contains a "first solution" how JSON could be fetched. Is there a chance to get that or something similar into master in near future?

cheers, Christoph

Watcher24 avatar Nov 06 '14 09:11 Watcher24