如何使用 FQL 获取高分辨率页面和图片的提要

发布于 2024-10-29 08:00:29 字数 770 浏览 1 评论 0原文

我正在尝试从像可口可乐这样的页面获取所有提要,并且我想以大分辨率获取此页面的相关图片,但我只有小版本。但我不知道如何直接从提要中获取大版本。

我正在使用 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];

I'm trying to get all the feeds from a page like coca-cola and I want to get the related picture of this page in big resolution I only have small version. But I don't know how to get the big version from the feed directly.

I'm using 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];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年华零落成诗 2024-11-05 08:00:29

我发现,如果你经过相册,你可以检索高分辨率的照片。

- (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];    
}

I found it if you pass by the albums you can retrieve photo in high res.

- (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];    
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文