图api返回不同的结果

时间:2011-12-01 07:47:05

标签: java facebook facebook-graph-api

我使用graph api在我的应用中获取墙页数据,大部分结果是正确的,就像:http://www.facebook.com/CliniqueKorea?sk=wall

图表api返回结果:

"data": [
  {
     "id": "150625001703112_166948130070799",
     "from": {
        "name": "Eunjung Choi",
        "id": "100002150176649"
     },
     "to": {
        "data": [
           {
              "name": "Clinique Korea (\ud06c\ub9ac\ub2c8\ud06c \ucf54\ub9ac\uc544)",
              "category": "Health/beauty",
              "id": "150625001703112"
           }
        ]
     },
     "message": "\ubaa8\uc774\uc2a4\uccd0\uc368\uc9c0~!!\ub354\uc88b\uc544\uc9c4\uac74\uac00\uc694?\uc644\uc804 \uae30\ub300\ub418\uc694!:)",
     "actions": [
        {
           "name": "Comment",
           "link": "http://www.facebook.com/150625001703112/posts/166948130070799"
        },
        {
           "name": "Like",
           "link": "http://www.facebook.com/150625001703112/posts/166948130070799"
        }
     ],
     "type": "status",
     "created_time": "2011-12-01T06:59:02+0000",
     "updated_time": "2011-12-01T06:59:02+0000",
     "likes": {
        "data": [
           {
              "name": "Clinique Korea (\ud06c\ub9ac\ub2c8\ud06c \ucf54\ub9ac\uc544)",
              "category": "Health/beauty",
              "id": "150625001703112"
           }
        ],
        "count": 1
     },
     "comments": {
        "count": 0
     }
  },
     {
     "id": "150625001703112_166482160117396",
     "from": {
        "name": "Hana  Sim",
        "id": "100002625156282"
     },
     "to": {
        "data": [
           {
              "name": "Clinique Korea (\ud06c\ub9ac\ub2c8\ud06c \ucf54\ub9ac\uc544)",
              "category": "Health/beauty",
              "id": "150625001703112"
           }
        ]
     },
     "message": "\uc6b0\uc544\ud06c\ub9ac\ub2c8\ud06c\ub2f9 \u314e\u314e",
     "icon": "http://www.facebook.com/images/icons/mobile_app.gif",
     "actions": [
        {
           "name": "Comment",
           "link": "http://www.facebook.com/150625001703112/posts/166482160117396"
        },
        {
           "name": "Like",
           "link": "http://www.facebook.com/150625001703112/posts/166482160117396"
        }
     ],
     "type": "status",
     "application": {
        "name": "Facebook for iPhone",
        "canvas_name": "fbtouch",
        "namespace": "fbtouch",
        "id": "6628568379"
     },
     "created_time": "2011-11-30T08:30:41+0000",
     "updated_time": "2011-11-30T08:30:41+0000",
     "likes": {
        "data": [
           {
              "name": "Hana  Sim",
              "id": "100002625156282"
           }
        ],
        "count": 3
     },
     "comments": {
        "count": 0
     }
  }...

你可以看到大多数结果都是我想要的信息。

但在某些页面中,例如:http://www.facebook.com/profile.php?id=100001147555576&sk=wall

结果由api返回:

    {
   "data": [
      {
         "id": "100001147555576_266423100072606",
         "from": {
            "name": "Singapore Motoring",
            "id": "100001147555576"
         },
         "story": "Singapore Motoring is now friends with Edys Tan and 2 other people.",
         "story_tags": {
            "0": [
               {
                  "id": 100001147555576,
                  "name": "Singapore Motoring",
                  "offset": 0,
                  "length": 18
               }
            ],
            "39": [
               {
                  "id": 1700056810,
                  "name": "Edys Tan",
                  "offset": 39,
                  "length": 8
               }
            ],
            "52": [
               {
                  "id": 626100607,
                  "name": "Koh Yu Han",
                  "offset": 52,
                  "length": 14
               },
               {
                  "id": 626628359,
                  "name": "Joanna Goh",
                  "offset": 52,
                  "length": 14
               }
            ]
         },
         "picture": "http://profile.ak.fbcdn.net/hprofile-ak-ash2/372622_1700056810_1487346255_q.jpg",
         "link": "http://www.facebook.com/EdysTan?ref=nf_fr",
         "type": "link",
         "created_time": "2011-12-01T03:19:01+0000",
         "updated_time": "2011-12-01T03:19:01+0000",
         "comments": {
            "count": 0
         }
      },
      {
         "id": "100001147555576_263310183717231",
         "from": {
            "name": "Singapore Motoring",
            "id": "100001147555576"
         },
         "story": "Singapore Motoring is now friends with Desmond Yu and 8 other people.",
         "story_tags": {
            "0": [
               {
                  "id": 100001147555576,
                  "name": "Singapore Motoring",
                  "offset": 0,
                  "length": 18
               }
            ],
            "39": [
               {
                  "id": 522271249,
                  "name": "Desmond Yu",
                  "offset": 39,
                  "length": 10
               }
            ],
            "54": [
               {
                  "id": 100000975216743,
                  "name": "Sam Lee",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 624733226,
                  "name": "Sidney Teo",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 1465023630,
                  "name": "Ong Watson",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 100000692455383,
                  "name": "Toh See Leong",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 100000841059476,
                  "name": "ArmorCoat Singapore",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 868260343,
                  "name": "Leonard Lee",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 100001292235835,
                  "name": "Mark Tan",
                  "offset": 54,
                  "length": 14
               },
               {
                  "id": 1800206696,
                  "name": "Jek Han",
                  "offset": 54,
                  "length": 14
               }
            ]
         },
         "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/273854_522271249_715126820_q.jpg",
         "link": "http://www.facebook.com/profile.php?id=522271249&ref=nf_fr",
         "type": "link",
         "created_time": "2011-11-29T02:30:05+0000",
         "updated_time": "2011-11-29T02:30:05+0000",
         "comments": {
            "count": 0
         }
      },
      {
         "id": "100001147555576_262705100444406",
         "from": {
            "name": "Singapore Motoring",
            "id": "100001147555576"
         },
         "story": "Singapore Motoring is now friends with Alvin Khor and Stella Lee.",
         "story_tags": {
            "0": [
               {
                  "id": 100001147555576,
                  "name": "Singapore Motoring",
                  "offset": 0,
                  "length": 18
               }
            ],
            "39": [
               {
                  "id": 100000728477072,
                  "name": "Alvin Khor",
                  "offset": 39,
                  "length": 10
               }
            ],
            "54": [
               {
                  "id": 579375325,
                  "name": "Stella Lee",
                  "offset": 54,
                  "length": 10
               }
            ]
         },
         "type": "status",
         "created_time": "2011-11-23T01:51:09+0000",
         "updated_time": "2011-11-23T01:51:09+0000",
         "comments": {
            "count": 0
         }
      },
    ....

<pre>

大部分结果都是故事,但不是信息,为什么?

1 个答案:

答案 0 :(得分:0)

这些是完全不同的对象类型,一个是用户配置文件,另一个是页面。他们/馈送连接中有不同的连接和不同的故事

见这里:

相关问题