public PlacesList < Place > placesForUser ( int placeType , String woeId , String placeId , String threshold , Date minUploadDate , Date maxUploadDate , Date minTakenDate , Date maxTakenDate ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; PlacesList < Place > placesList = new PlacesList < Place > ( ) ; parameters . put ( "method" , METHOD_PLACES_FOR_USER ) ; parameters . put ( "place_type" , intPlaceTypeToString ( placeType ) ) ; if ( placeId != null ) { parameters . put ( "place_id" , placeId ) ; } if ( woeId != null ) { parameters . put ( "woe_id" , woeId ) ; } if ( threshold != null ) { parameters . put ( "threshold" , threshold ) ; } if ( minUploadDate != null ) { parameters . put ( "min_upload_date" , Long . toString ( minUploadDate . getTime ( ) / 1000L ) ) ; } if ( maxUploadDate != null ) { parameters . put ( "max_upload_date" , Long . toString ( maxUploadDate . getTime ( ) / 1000L ) ) ; } if ( minTakenDate != null ) { parameters . put ( "min_taken_date" , ( ( DateFormat ) SearchParameters . MYSQL_DATE_FORMATS . get ( ) ) . format ( minTakenDate ) ) ; } if ( maxTakenDate != null ) { parameters . put ( "max_taken_date" , ( ( DateFormat ) SearchParameters . MYSQL_DATE_FORMATS . get ( ) ) . format ( maxTakenDate ) ) ; } Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element placesElement = response . getPayload ( ) ; NodeList placesNodes = placesElement . getElementsByTagName ( "place" ) ; placesList . setPage ( "1" ) ; placesList . setPages ( "1" ) ; placesList . setPerPage ( "" + placesNodes . getLength ( ) ) ; placesList . setTotal ( "" + placesNodes . getLength ( ) ) ; for ( int i = 0 ; i < placesNodes . getLength ( ) ; i ++ ) { Element placeElement = ( Element ) placesNodes . item ( i ) ; placesList . add ( parsePlace ( placeElement ) ) ; } return placesList ; }
Return a list of the top 100 unique places clustered by a given placetype for a user .