2011-03-31 33 views
0

我想從可口可樂這樣的頁面獲取所有的飼料,我想以高分辨率獲得此頁面的相關圖片我只有小版本。但我不知道如何直接從Feed中獲取大版本。如何獲取高分辨率的頁面和圖片的飼料與FQL

我使用ios-facebook-sdk。

// Get Feed 
[_facebook requestWithGraphPath:@"coca-cola/feed" andDelegate:self]; 

// Get Photo 
NSString *req = @"SELECT pid,owner,src_big, object_id FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = 40796308305)"; 
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           req, @"query", 
           [_facebook accessToken], @"access_token", 
           nil]; 
[_facebook requestWithMethodName:@"fql.query" 
         andParams:params 
        andHttpMethod:@"POST" 
        andDelegate:self]; 

回答

0

我發現它,如果你通過相冊,你可以檢索高分辨率的照片。

- (IBAction)getPageFeed:(id)sender { 
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__); 
    // Get Feed 
    [_facebook requestWithGraphPath:@"APIID/feed" andDelegate:self]; 
} 

- (IBAction)getGetAlbums:(id)sender { 
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__); 
    [_facebook requestWithGraphPath:@"APIID/albums" andDelegate:self];  
} 

- (IBAction)getAllPhotos:(id)sender { 
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__); 

    int index = 0; 
    int iteration = 0; 
    for (id i in [sender objectForKey:@"data"]) { 
     if ([[i objectForKey:@"name"] isEqual:@"Wall Photos"]) { 
      index = iteration; 
     } 
     iteration++; 
    } 
    [_facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/photos", [[[sender objectForKey:@"data"] objectAtIndex:index] objectForKey:@"id"]] andDelegate:self];  
}