从Facebook Graph获取民意调查结果 [英] Getting poll results from Facebook Graph

查看:87
本文介绍了从Facebook Graph获取民意调查结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何(如果可以的话)从Facebook图表中获得民意测验/问题的结果?目前,我得到的是与下面类似的内容:

How can I (if I can) get the results of a poll/question from Facebook graph? Currently I get back something similar to what is below:

"data": [
      {
         "id": "12345_12345",
         "from": {
            "name": "My Company Name",
            "category": "Category",
            "id": "12345"
         },
         "story": "This is my question",
         "icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yy/r/pz5wRf7MB0H.png",
         "privacy": {
            "description": "Public",
            "value": "EVERYONE"
         },
         "type": "question",
         "object_id": "12345",
         "application": {
            "name": "Questions",
            "id": "12345"
         },
         "created_time": "2012-04-25T12:23:03+0000",
         "updated_time": "2012-04-25T12:23:03+0000",
         "comments": {
            "count": 0
         }
      }

我可以获取有关此问题的更多信息吗?我目前正在使用PHP + CURL来获取供稿.

Can I get more information back about this question? I'm currently using PHP + CURL to get the feed.

谢谢!

推荐答案

从外观上,您已经查询了特定的帖子(post-id:12345_12345):https://graph.facebook.com/12345_12345.

From the looks of it, you have queried for the specific post (post-id:12345_12345) : https://graph.facebook.com/12345_12345 .

要访问

To get to the question's data we have to query for the question id that is given in this post's data itself:

"type": "question",
"object_id": "12345",

从这里获得问题的ID,即object_id:12345.使用此ID,我们可以获得问题的信息,因此查询网址为:https://graph.facebook.com/12345.

from here we have the question's id, i.e object_id:12345. Using this id we can get the question's info, so query url is : https://graph.facebook.com/12345.

在问题的返回信息中,我们还将具有

In the question's returned info, we'll also have the options of the poll, it'll be a field named options. Each option's info will be given within this field, and each option has a votes field, which will tell you the number of votes that option received. So you'll have the results of the poll.

使用图形浏览器,在对它们进行编码之前对其进行测试.并阅读文档链接以了解有关问题的更多信息.

Use the graph explorer, to test these things, before you code them. And do read the documentation links to know more about questions.

这篇关于从Facebook Graph获取民意调查结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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