我应该如何检索 Facebook 帖子中包含的原始图片?

发布于 2024-12-13 10:54:10 字数 1555 浏览 0 评论 0原文

我的应用程序使用 Facebook Javascript SDK 将墙贴添加到社区页面的提要中,并再次检索它们。帖子中包含的图片经过处理并放置在 Facebook 服务器上的某个位置。

当这些帖子被检索到时,图片的链接变成了指向 fbcdn.net 服务器的链接。

有没有办法访问原始链接?

更新:

这是我发布帖子的代码:

    // The "params" variable contains a field called "picture"
    // (which is a link pointing to my picture)
    FB.addWallPost = function (params, pageId, token, complete) {
        var fbApiParams = {
            access_token: token
        };
        $.extend(fbApiParams, params);
        FB.api(pageId + '/feed', 'post', fbApiParams, function (response) {
            // FB.apiCallDone is a function checking if there's any positive response
            if (FB.apiCallDone(response)) {
                complete(response.id);
            }
            else {
                complete(null);
            }
        });
    }

这些行检索帖子:

FB.getWallPosts = function (wallPostsIds, token, complete) {
    if (wallPostsIds && wallPostsIds != null && wallPostsIds.length) {
        var wallPostsIdsStr = wallPostsIds.join(',');
        var fbApiParams = {
            ids: wallPostsIdsStr,
            access_token: token
        };
        FB.api('/', fbApiParams, function (response) {
            if (FB.apiCallDone(response)) {
                var wallPosts = dictElemsToArr(response);                    
                complete(wallPosts);
            }
            else {
                complete([]);
            }
        });
    }
    else {
        complete([]);
    }
}

My application uses the Facebook Javascript SDK to add wall posts to the feed of a community's page, and to retrieve them again. Pictures included with the posts are processed and placed somewhere on the Facebook servers.

When these posts are retrieved the links to the pictures turn out to be links pointing to the fbcdn.net server.

Is there a way to access the original links?

Update:

Here is my code posting a post:

    // The "params" variable contains a field called "picture"
    // (which is a link pointing to my picture)
    FB.addWallPost = function (params, pageId, token, complete) {
        var fbApiParams = {
            access_token: token
        };
        $.extend(fbApiParams, params);
        FB.api(pageId + '/feed', 'post', fbApiParams, function (response) {
            // FB.apiCallDone is a function checking if there's any positive response
            if (FB.apiCallDone(response)) {
                complete(response.id);
            }
            else {
                complete(null);
            }
        });
    }

And these lines retrieve the posts:

FB.getWallPosts = function (wallPostsIds, token, complete) {
    if (wallPostsIds && wallPostsIds != null && wallPostsIds.length) {
        var wallPostsIdsStr = wallPostsIds.join(',');
        var fbApiParams = {
            ids: wallPostsIdsStr,
            access_token: token
        };
        FB.api('/', fbApiParams, function (response) {
            if (FB.apiCallDone(response)) {
                var wallPosts = dictElemsToArr(response);                    
                complete(wallPosts);
            }
            else {
                complete([]);
            }
        });
    }
    else {
        complete([]);
    }
}

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

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

发布评论

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

评论(1

情绪 2024-12-20 10:54:10

如果您将图片发布到 Facebook,它们将由 Facebook 存储在本地。

如果您的应用程序需要此信息,则由您的应用程序来存储原始图像的路径。

If you're posting pictures to Facebook, they will be stored locally by Facebook.

It is up to your application to store the path of the original images if your application requires this information.

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