使用Facebook Open Graph API创建对象 [英] Creating objects with the Facebook Open Graph API

查看:46
本文介绍了使用Facebook Open Graph API创建对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google App Engine托管我的Facebook应用程序,因为它在配额方面是最慷慨的.我想使用Open Graph API来发布操作(煮比萨饼,煮鸡肉,煮馅饼等)

I am using Google App Engine to host my Facebook Application because it is the most generous in terms of quota. I would like to use the Open Graph API to publish actions (cook a pizza, cook a chicken, cook a pie, etc.)

由于Python Facebook SDK现在已被弃用,我想知道是否有人可以就其可以访问的功能来解释我的应用程序的局限性.看来我可以使用JavaScript SDK来对用户进行身份验证,发布操作等.

Since the Python Facebook SDK is now deprecated, I was wondering if someone can explain the limitations of my app in terms of what features it is able to access. It seems like I can use the JavaScript SDK to authenticate the user, publish actions, etc.

这是我的应用程序界面的html客户端上的元标记:

Here is my meta tags at the html client-side of my app interface:

<meta property="fb:app_id"      content="250027595026486" /> 
<meta property="og:type"        content="socialdocking:chemical" /> 
<meta property="og:url"         content="http://beta2.socialdocking.appspot.com/" /> 
<meta property="og:title"       content="Sample Chemical" /> 
<meta property="og:description" content="Some Arbitrary String" /> 
<meta property="og:image"       content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />

在没有从服务器手动写入的情况下,如何为化学药品"和化学药品"使用不同的值?是否可以在发布操作之前使用AJAX检索值并更改"Sample Chemical"值?换句话说,我是否必须遵守以单个网页表示开放图对象"的设计,还是可以使用一个网页同时表示多个对象?

How can I have different values for 'Sample Chemical' the 'Chemical' without manually writing it from the server? Is it possible to retrieve a value using AJAX and change the value "Sample Chemical" before publishing the action? In other words, do I have to abide by the design that an Open Graph "Object" is represented by a single web page, or can I use a single web page to represent multiple objects simultaneously?

谢谢!

推荐答案

在Facebook抓取元标记之前,您无法使用Javascript动态设置元标记.您必须从服务器端执行此操作.但是,您要在此处完成的操作不需要您使用Facebook SDK.这是一个有关如何执行此操作的PHP示例:动态生成Facebook Open Graph元标记我确定您可以将其转移代码输入Python.

You cannot set meta tags dynamically with Javascript before Facebook scrapes them. You must do it from server side. However, what you want to accomplish here doesn't require you to use the Facebook SDK. Here is a PHP example on how to do it: Generating Facebook Open Graph meta tags dynamically I'm sure you can transfer that code into Python.

这篇关于使用Facebook Open Graph API创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆