Menu

#75 PoolsInterface Possible Bug

open
nobody
None
5
2011-05-16
2011-05-16
mm1988
No

I used the following code to get all the photos of the group's pool but there was an issue with the number.

public class Main {
static String apiKey = MYAPIKEY;
static String apiSecret = MYSECRET;

public static void main(String args[]) throws IOException, SAXException,FlickrException, ParserConfigurationException {
Flickr flickRInstance = new Flickr(apiKey, apiSecret, new REST());
PoolsInterface poolsInterface=flickRInstance.getPoolsInterface();

Vector<PhotoList> listVector=new Vector<PhotoList>();

for(int j=1;true;j++){
PhotoList currentList = poolsInterface.getPhotos("380643@N20", null, null, 100, j);
listVector.add(currentList);
System.out.println(j);
if(currentList.size()==0)
break;
}

int number=0;

for (int i = 0; i < listVector.size(); i++) {
PhotoList photoList=listVector.get(i);
number+=photoList.size();
}
System.out.println(number);
}

I tested in group 380643@N20 which has 148 photos but the returned number was 146 photos. In group 68646561@N00 the proper number was 5017 but the number that was displayed was 4824. I can't see an error in my code (maybe there is something trivial or I may have misused the API) but I think it should have returned the proper number.

Discussion


Log in to post a comment.