4

我正在尝试从组内用户的帖子中提取照片。群组中的帖子似乎被创建为“照片”或“状态”。

当使用以下方法将其创建为“照片”时,我可以从组内的帖子中提取照片:

SELECT attachment FROM stream WHERE post_id="<postid>"

但是,如果帖子是作为“状态”创建的,则此查询不会返回附件的任何数据。

这是一个创建为“状态”的帖子的示例以及结果是什么。当我知道该帖子有一张照片时,没有附件(照片)的数据。

SELECT attachment, type, message, created_time FROM stream WHERE post_id = '<postid>'

{
  "data": [
    {
      "attachment": {
        "description": ""
      }, 
      "type": 308, 
      "message": "Ceramic wall hanging with mirror from Spain (6\"x8\") $5 pickup in SR",  
      "created_time": 1379101402
    }
  ]
}

这是权限问题还是我只是没有从此类帖子的正确表中提取?

谢谢克里斯

4

1 回答 1

1

只是说它对我有用:

SELECT post_id, attachment, type, message, created_time FROM stream WHERE post_id="POST_ID"

POST_ID看起来像:481234567779150_559912345679366。我使用的权限是user_groupsuser_friends

{
  "data": [
    {
      "post_id": "481234567779150_559912345679366", 
      "attachment": {
        "media": [
          {
            "href": "https://www.facebook.com/photo.php?fbid=10123450&set=gm.5599123456789366&type=1&relevant_count=1", 
            "alt": "bla bla bla", 
            "type": "photo", 
            "src": "https://fbcdn-photos-f-a.akamaihd.net/hphotos-ak-prn1/1013188_102013456789034740_1177097408_s.jpg", 
            "photo": {
              "aid": "65904234567838363", 
              "pid": "65904345678990795", 
              "fbid": "10202345678934740", 
              "owner": 1533245678910, 
              "index": 1, 
              "width": 1032, 
              "height": 581, 
              "images": [
                {
                  "src": "https://fbcdn-photos-f-a.akamaihd.net/hphotos-ak-prn1/1013188_10123456789_1177097408_s.jpg", 
                  "width": 130, 
                  "height": 73
                }
              ]
            }
          }
        ], 
        "name": "", 
        "caption": "", 
        "description": "", 
        "properties": [
        ], 
        "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif", 
        "fb_object_type": "photo", 
        "fb_object_id": "65123456789090795"
      }, 
      "type": 308, 
      "message": "bla bla bla", 
      "created_time": 1373368884
    }
  ]
}

您是否在Graph API Explorer中尝试过查询?你能提供更多信息吗?它是一个什么样的团体,秘密的,公开的?用户是您的朋友之一吗?我个人尝试过公共或私人团体以及朋友或非朋友的帖子。您能否确认其他308类型的带有照片和多个群组的帖子会发生这种情况?

于 2013-09-13T23:07:23.193 回答