如何在Python中进行FQL查询?
假设用户已经使用 javascript SDK 进行了身份验证,您将如何在 python 中执行 FQL 查询 ->
query = 'SELECT page_id FROM page_admin WHERE uid = ' + user_id
我已阅读文档,看来您必须点击此网址 ->
https://api.facebook.com/method/fql.query?query=QUERY
你是如何做到这一点的?另外,您是否需要在网址中传递访问令牌,如果是,那么如何传递?
Assuming that the user is already authenticated using the javascript SDK, how would you execute FQL queries in python ->
query = 'SELECT page_id FROM page_admin WHERE uid = ' + user_id
I've read the documentation and it seems that you got to hit this url ->
https://api.facebook.com/method/fql.query?query=QUERY
How do you do this? Also do you need to pass the access token in the url, if yes then how ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
输出:
FQL 参考
output:
FQL reference
对于 https://api.facebook.com/method/fql.query?query=查询
将 QUERY 替换为 FQL,
例如:https://api.facebook.com/method/fql.query?query=SELECT%20aid,%20owner,%20name,%20object_id%20FROM%20album%20WHERE%20aid=%2220531316728_324257%22
for https://api.facebook.com/method/fql.query?query=QUERY
Replace QUERY with FQL,
for example:https://api.facebook.com/method/fql.query?query=SELECT%20aid,%20owner,%20name,%20object_id%20FROM%20album%20WHERE%20aid=%2220531316728_324257%22
您应该使用 urllib2,检查 urlopen 方法。
您将需要访问令牌,具体取决于您正在执行的查询,例如,如果您想检索相册,则需要访问令牌以及 user_photos 和friend_photos 权限,以检索一些您不需要的粉丝页面信息。
You should use urllib2, check the urlopen method.
You would need access token depending on the query you are doing, for example if you want to retrieve an photo album you would need the access token and user_photos and friend_photos permissions, for retrieving some fan page information you don't need any.