public PhotoList < Photo > getClusterPhotos ( String tag , String clusterId ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_CLUSTER_PHOTOS ) ; parameters . put ( "tag" , tag ) ; parameters . put ( "cluster_id" , clusterId ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photosElement = response . getPayload ( ) ; NodeList photoNodes = photosElement . getElementsByTagName ( "photo" ) ; photos . setPage ( "1" ) ; photos . setPages ( "1" ) ; photos . setPerPage ( "" + photoNodes . getLength ( ) ) ; photos . setTotal ( "" + photoNodes . getLength ( ) ) ; for ( int i = 0 ; i < photoNodes . getLength ( ) ; i ++ ) { Element photoElement = ( Element ) photoNodes . item ( i ) ; photos . add ( PhotoUtils . createPhoto ( photoElement ) ) ; } return photos ; }
Returns the first 24 photos for a given tag cluster .