【问题标题】:Is that possible to create facebook search link in iframe?是否可以在 iframe 中创建 facebook 搜索链接?
【发布时间】:2015-07-20 19:14:42
【问题描述】:

我想在 facebook 上搜索 lightbox plugin,它使用 iframe 作为链接。
facebook原始搜索url是这样的:
https://www.facebook.com/search/results/?q=someword

但不幸的是,此网址在控制台中返回此消息:

拒绝显示 'facebook.com/search/results/?q=someword' 在 框架,因为它将“X-Frame-Options”设置为“DENY”。

是否可以在 iframe 中创建 facebook 搜索链接?

【问题讨论】:

    标签: facebook iframe


    【解决方案1】:

    你不应该像那样使用 facebook.com,你必须使用 Graph API 来处理这些事情。幸运的是,有一个搜索 API:https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#search

    示例:http://graph.facebook.com/search?q=somequerystring&type=user

    ...当然,您需要为此使用访问令牌。访问令牌信息:

    虽然公共帖子搜索 API 已被弃用,但您无法再搜索帖子。 Search API 的所有选项都在文档中进行了说明。

    换句话说:图搜索没有 API。

    【讨论】:

    • 不,你不能在这样的 iframe 中使用 api。您需要开始阅读基本文档:developers.facebook.com/docs - 忘记那个奇怪的 iframe 解决方案,它不会起作用。你不能只使用一个特定的 url 并完成它。
    • 好吧,谢谢你,我认为这是一个更难的问题,就像我之前想的那样。
    • 这是肯定的。您需要了解用户授权/登录、访问令牌和图形 API。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-29
    • 1970-01-01
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 2012-12-19
    相关资源
    最近更新 更多