通过FaceBook API检索我自己的数据 [英] Retrieving my own data via FaceBook API

查看:95
本文介绍了通过FaceBook API检索我自己的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个喜剧小组建立一个网站,该网站使用Facebook作为他们的营销平台之一;新网站的要求之一是在日历上显示其所有Facebook事件.

I am building a website for a comedy group which uses Facebook as one of their marketing platforms; one of the requirements for the new site is to display all of their Facebook events on a calendar.

当前,我只是试图将一个Python脚本放到一起,该脚本可以从我自己的Facebook帐户中提取一些数据,例如我所有朋友的列表.我想我一旦做到这一点,就可以从客户帐户中提取更复杂的数据(因为他们已经允许我访问他们的帐户).

Currently, I am just trying to put together a Python script which can pull some data from my own Facebook account, like a list of all my friends. I presume once I can accomplish this I can move to pulling more complicated data out of my clients account (since they have given me access to their account).

我看过这里的许多文章,还浏览了Facebook API文档,包括Facebook Connect,但确实让我头疼不已.我阅读的所有内容似乎都过头了,因为它涉及到建立大量的基础结构,以允许我的应用程序建立与任意用户帐户(授权我的帐户)的连接.鉴于我只需要访问1个帐户,这岂不是更简单吗?

I have looked at many of the posts here, and also went through the Facebook API documentation, including Facebook Connect, but am really beating my head against the wall. Everything I have read seems like overkill, as it involves setting up a good deal of infrastructure to allow my app to set up connections to any arbitrary user's account (who authorizes me). Shouldn't it be much simpler, given I only ever need to access 1 account?

我无法找到一种无需显示Facebook登录窗口即可检索数据的方法.我有一个脚本可以检索我所有的朋友,但是它包含一个重定向,我必须亲自将自己登录到Facebook.

I cannot find a way to retrieve data without having to display the Facebook login window. I have a script which will retrieve all my friends, but it includes a redirect where I have to physically log myself in to Facebook.

将不胜感激任何建议或链接,我只是觉得我必须缺少一些简单的东西.

Would appreciate any advice or links, I just feel like I must be missing something simple.

谢谢!

推荐答案

的确,Facebook的API是针对正在创建将被许多用户使用的应用程序的开发人员的.

It is true, that Facebook's API is targeted at developers who are creating apps that will be used by many users.

值得庆幸的是,新的Graph API比其前身更易于使用,并且在不使用或不创建大量底层基础结构的情况下使用它也不会造成很大的困难.

Thankfully, the new Graph API is much simpler to use than its predecessor, and shouldn't be terribly difficult for you to work with without using or creating a lot of underlying infrastructure.

需要实施授权,但这并不困难,只要您提示用户输入offline_access权限,则只需执行一次即可.

You will need to implement authorization, but this is not difficult, and as long as you prompt the user for the offline_access permission, it'll only need to be done once.

台式机身份验证上的文档目前可能与您最相关,尽管您可能要在网络应用程序启动并运行后转向基于JavaScript的身份验证.

The documentation on Desktop Authentication would probably be most relevant to you at this point, though you might want to move to the javascript-based authentication once you've got a web app up and running.

完成身份验证后,您要做的就是向各种网址发出GET请求并使用生成的JSON.

Once the authentication is done, all you're doing is making GET requests to various urls and working with the resulting JSON.

这是有关事件的文档,您可以从

Here's the documentation about Events, and you can get a list of friends from the friends connection of a User.

这篇关于通过FaceBook API检索我自己的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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