Facebook 应用托管在 Google App Engine 上
我是 Facebook 应用程序的新手,我已经在 GAE 上启动并运行了一个应用程序(使用 python)。我想将它与 Facebook 集成,这样我就可以访问一些用户的数据来帮助我个性化应用程序(例如喜欢的页面、兴趣、他们来自哪里等数据)。还可以分享应用程序的输出以供朋友查看。
我以为我会选择 https://developers.facebook.com/ 上的 Facebook 应用程序选项,但
我不这么 认为不知道从哪里开始,有一些教程(其中大多数都很旧,有些使用已弃用的脚本,所以有点令人担忧),还有 FBML.. 我想也许我可以获得相同的数据仅使用 Facebook 登录然后使用FQL 来访问这些数据。
我不知道我是否会受到新的 https 限制的困扰(Facebook 表示从 2011 年 10 月起必须拥有 SSL 证书)。
所以底线..我从哪里开始?
I am new to Facebook apps, I have an app already up and running on GAE (using python). I want to integrate it with Facebook so I can access some of the users' data to help me personalize the app (data like the liked pages, interests, where they are from etc..). And also to share the app's outputs to be seen by friends.
I thought I would go for the Facebook app option on https://developers.facebook.com/
I don't know where to start from, there are some tutorials (most of them are very old, some use scripts that are deprecated so it is a bit worrying), and there's FBML.. and I was thinking that maybe I can get the same data by only using Facebook's log in then use FQL to access these data.
And I don't know if I will get stuck with that new https restriction (Facebook says that it is required as of October 2011 to have an SSL certificate).
So bottom line.. where do I start?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们开始:
从此链接下载: https://github.com/jgorset/ facepy/tree/master/facepy:
从下载中,您将拥有:
signed_request.py
用于解析 facebook 将在您的帐户中发布的signed_request画布网址:
POST
方法中的https://apps.facebook.com/myapp
和
graph_api.py
对graphapi进行操作
https://developers.facebook.com/docs/reference/api/< /a>注意:您将包含来自 cookie 的 access_token由facebook js sdk编写。
对于fb js sdk,请参阅此答案:
您的 javascript部分的https://stackoverflow.com/a/8625873/492258索引页:
对于连续调用,您将使用我上面提到的 cookie:
对于注册,从 fb js sdk 执行的最简单方法,我已经提到过
不要忘记为 Internet Explorer 设置 P3P,iframre cookie 问题:
Here we go:
From this link do download: https://github.com/jgorset/facepy/tree/master/facepy:
from downloads, you will have:
signed_request.py
to parse signed_request that will be posted by facebook in yourcanvas url:
https://apps.facebook.com/myapp
inPOST
methodand
graph_api.py
to make operation tographapi
https://developers.facebook.com/docs/reference/api/note: you will be including access_token from cookies written by facebook js sdk.
for fb js sdk see this answer: https://stackoverflow.com/a/8625873/492258 of javascript part
in your index page:
for successive calls, you'll be using cookies that I mentioned above:
For registration, the easiest way doing from fb js sdk, already I mentioned
Don't forget to set P3P for internet explorer, iframre cookie issue:
您需要针对 Facebook 验证您的服务器应用程序 (GAE):您需要实施服务器端身份验证流程。
有关示例实现,请参阅 LeanEngine(开源): 服务器身份验证类。
通过身份验证并获得用户 FB 身份验证令牌后,您可以使用 FB Graph API 获取各种数据。
You need to authenticate your server app (GAE) against Facebook: you need to implement server-side authentication flow.
See LeanEngine (open-source) for an example implementation: server auth classes.
Once you are past authentication and you get user FB auth token, you can use FB Graph API to get all kinds of data.