简体   繁体   English

Facebook OpenGraph-使用FB.api进行发布

[英]Facebook OpenGraph - POSTing using the FB.api

This might be a beginners question, but I have to ask it nonetheless since I don't really understand this. 这可能是一个初学者的问题,但是由于我不太了解这个问题,因此我不得不提出这个问题。 I have successfully debugged my page and the user is authenticated to use the app. 我已经成功调试了页面,并且用户通过了身份验证才能使用该应用程序。 So the debugger is picking up all my meta og: tags properly. 因此,调试器正确地提取了我的所有meta og:标签。 Running the below function allows me to a post a status update to my timeline which is 'A status update'. 运行以下功能可让我在时间轴上发布状态更新,即“状态更新”。 But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. 但这不是我想要的,我想要meta og:标记创建一个特定页面的漂亮文章,这是Open Graph的全部内容,但是那没有发生,这只是一个普通的无聊状态更新,带有指向我页面的链接。 Why? 为什么?

FB.api(
 '/me/[my namespace]:button',
 'post',
 { message: 'A status update' },
 callback function
});

Additionally, what am I actually supposed to put in the third parameter, what is the third parameter for? 另外,我实际上应该输入第三个参数,第三个参数是做什么用的? That is the {message: 'A status update'} parameter. 那就是{message:'状态更新'}参数。

Finally, is this the way to post to timeline using opengraph and apps? 最后,这是使用opengraph和应用程序发布到时间轴的方法吗? I am not sure as I don't know what that stuff they have when I 'get code' on the developers page is. 我不确定,因为我不知道在开发人员页面上“获取代码”时他们拥有的东西。 That curl stuff, what's that for? 那卷曲的东西是什么用的? I can't have that on my page? 我的页面上无法显示吗?

But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. 但这不是我想要的,我想要meta og:标记创建一个特定页面的漂亮文章,这是Open Graph的全部内容,但是那没有发生,这只是一个普通的无聊状态更新,带有指向我页面的链接。 Why? 为什么?

Because you're not giving the address of any Open Graph object with your action … there's no URL anywhere, so where do you think Facebook should pull the OG meta data from …? 因为您没有通过操作提供任何Open Graph 对象的地址…在任何地方都没有URL,那么您认为Facebook应该在哪里提取…的OG元数据?

Set your action up in a way so that it references some kind of OG object, and then give that object's URL when you're publishing the action. 以某种方式设置操作,使其引用某种OG对象,然后在发布操作时提供该对象的URL。

The examples in the Open Graph documentation in the developer section should make pretty clear how it works. 开发人员部分的“打开图”文档中的示例应清楚说明其工作原理。

https://developers.facebook.com/docs/opengraph/actions/#create https://developers.facebook.com/docs/opengraph/actions/#create

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM