public Collection < Contact > getListRecentlyUploaded ( Date lastUpload , String filter ) throws FlickrException { List < Contact > contacts = new ArrayList < Contact > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST_RECENTLY_UPLOADED ) ; if ( lastUpload != null ) { parameters . put ( "date_lastupload" , String . valueOf ( lastUpload . getTime ( ) / 1000L ) ) ; } if ( filter != null ) { parameters . put ( "filter" , filter ) ; } Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element contactsElement = response . getPayload ( ) ; NodeList contactNodes = contactsElement . getElementsByTagName ( "contact" ) ; for ( int i = 0 ; i < contactNodes . getLength ( ) ; i ++ ) { Element contactElement = ( Element ) contactNodes . item ( i ) ; Contact contact = new Contact ( ) ; contact . setId ( contactElement . getAttribute ( "nsid" ) ) ; contact . setUsername ( contactElement . getAttribute ( "username" ) ) ; contact . setRealName ( contactElement . getAttribute ( "realname" ) ) ; contact . setFriend ( "1" . equals ( contactElement . getAttribute ( "friend" ) ) ) ; contact . setFamily ( "1" . equals ( contactElement . getAttribute ( "family" ) ) ) ; contact . setIgnored ( "1" . equals ( contactElement . getAttribute ( "ignored" ) ) ) ; contact . setOnline ( OnlineStatus . fromType ( contactElement . getAttribute ( "online" ) ) ) ; contact . setIconFarm ( contactElement . getAttribute ( "iconfarm" ) ) ; contact . setIconServer ( contactElement . getAttribute ( "iconserver" ) ) ; if ( contact . getOnline ( ) == OnlineStatus . AWAY ) { contactElement . normalize ( ) ; contact . setAwayMessage ( XMLUtilities . getValue ( contactElement ) ) ; } contacts . add ( contact ) ; } return contacts ; }
Return a list of contacts for a user who have recently uploaded photos along with the total count of photos uploaded .