Skip to content

Instantly share code, notes, and snippets.

@mrsidique
Created January 31, 2012 06:55
Show Gist options
  • Select an option

  • Save mrsidique/1709298 to your computer and use it in GitHub Desktop.

Select an option

Save mrsidique/1709298 to your computer and use it in GitHub Desktop.
- (void) sendFacebookRequest {
if (initialLoad) {
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
activityIndicator.frame = CGRectMake(120, 115, 100, 100);
[activityIndicator startAnimating];
[self.view addSubview:activityIndicator];
}
[SVProgressHUD showWithStatus:@"Refreshing Photos"];
AppDelegate *delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
NSString *getUsers = @"{'getUsers':'select uid2 from friend where uid1=me()'";
NSString *getAlbums = @"'getAlbums':'select aid from album where owner in (select uid2 from #getUsers) order by modified desc limit 100'";
NSString *getTagged = @"'getTagged':'select pid from photo_tag where subject in (select uid2 from #getUsers) order by created desc limit 100'";
//NSString *getPics = @"'getPics':'select src_big, created, owner, caption, aid from photo where aid in (select aid from #getAlbums) order by created desc limit 100'}";
NSString *getPics = @"'getPics':'select src_big, created, owner, aid from photo where aid in (select aid from #getAlbums) or pid in (select pid from #getTagged) order by created desc limit 100'}";
//NSString *fql = [NSString stringWithFormat:@"%@,%@,%@", getUsers, getAlbums, getPics];
NSString *fql = [NSString stringWithFormat:@"%@,%@,%@,%@", getUsers, getAlbums, getTagged, getPics];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:fql, @"q", nil];
[[delegate facebook] requestWithGraphPath:@"fql" andParams:params andHttpMethod:@"GET" andDelegate:self];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment