Open Graph - 在发布的操作中获取和规范 URL

发布于 2025-01-02 03:58:37 字数 389 浏览 3 评论 0原文

我们目前正在测试桌面应用程序的 Facebook 功能。我们定义了一个 Facebook 应用程序,然后创建了开放图操作、对象和聚合。

  • 第一个问题:如果获取的(对象 URL)和规范(og:url)URL 不同,为什么标签取自规范 URL,而不是取自获取的 URL?首先拥有获取的 URL 和规范的 URL 有什么用?

  • 第二个问题:当发布一个操作并且用户点击 Facebook 聚合框中的相应链接时,我们看到其他参数与我们的 og:url 组合在查询字符串中(例如 ?fb_action_ids=##&fb_action_types =...&fb_source=recent_activity )。有没有办法保留我们的 og:url 并且不以这种方式扩展?

We are currently testing the Facebook functionality of our desktop application. We defined a Facebook app, then created open graph actions, objects and aggregations.

  • First question: in case the fetched (the object URL) and canonical (og:url) URLs differ, why the tags are taken from the canonical URL and not from the fetched URL? What's the use in having a fetched and a canonical URL in the first place?

  • Second question: when an action is posted and the user follows the corresponding link in a Facebook aggregation box, we see that additional parameters are combined in a query string with our og:url (e.g. ?fb_action_ids=##&fb_action_types=...&fb_source=recent_activity ). Is there a way to have our og:url preserved and not extended in such a way?

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

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

发布评论

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

评论(1

梦回梦里 2025-01-09 03:58:37

对于第二个问题,设置一个剥离查询字符串的对象页面应该足够简单。您可以简单地使用元刷新将用户重定向到您喜欢的任何位置,或者您可以使用 javascript:

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# appname: http://ogp.me/ns/fb/marrymakelovemurder#">
<meta property="fb:app_id" content="app_id" /> 
<meta property="og:type"   content="namepace:object" /> 
<meta property="og:url"    content="Put your own URL to the object here" /> 
<meta property="og:title"  content="Sample Game" /> 
<meta property="og:image"  content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> 

<meta http-equiv="refresh" content="0;URL='http://redirectURL'" />  

For the second question, it should be simple enough to set up an object page that strips the query string. You can simply use a meta refresh to redirect the user wherever you like, or you could use javascript:

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# appname: http://ogp.me/ns/fb/marrymakelovemurder#">
<meta property="fb:app_id" content="app_id" /> 
<meta property="og:type"   content="namepace:object" /> 
<meta property="og:url"    content="Put your own URL to the object here" /> 
<meta property="og:title"  content="Sample Game" /> 
<meta property="og:image"  content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> 

<meta http-equiv="refresh" content="0;URL='http://redirectURL'" />  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文