简体   繁体   English

Feed中的共享配置文件链接在JSON图形API中的数据不足

[英]Shared profile link in feed has insufficient data in JSON graph API

I was wondering if there is a way to show the actual profile that has been shared on the page feed. 我想知道是否有办法显示页面供稿上已共享的实际配置文件。 Right now the fields that are returned don't give much information. 现在,返回的字段没有提供太多信息。

I'm grabbing the feed as a json object, convert it to a php variable with json_decode and iterate over the returned array. 我将提要作为json对象获取,使用json_decode将其转换为php变量并遍历返回的数组。

Everything works just fine except when someone links to a profile of a page in their feed. 一切正常,除非有人链接到其供稿中页面的个人资料。

$fields = "id,message,picture,full_picture,link,name,description,type,icon,created_time,from,object_id,source";

https://graph.facebook.com/{$fb_page_id}/feed?access_token={$access_token}&fields={$fields}

Regular data item: 常规数据项:

[2] => Array
    (
        [id] => 12312452343463463_31253215252
        [message] => Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        [picture] => https://www.picture.com/ADSASD1223
        [full_picture] => https://www.picture.com/ADSASD1223_full
        [link] => http://www.link.com/
        [name] => Linkage
        [description] => Linkage is a link provider
        [type] => link
        [icon] => https://www.facebook.com/images/icons/post.gif
        [created_time] => 2016-02-23T16:07:05+0000
        [from] => Array
            (
                [name] => Test
                [id] => 1233434564567
            )

    )

Profile data item: 配置文件数据项:

[3] => Array
    (
        [id] => 31248734871234_312498341278341278
        [message] => Look!  It's John the Deer! Make sure to follow him!
        [type] => status
        [created_time] => 2016-02-21T19:16:24+0000
        [from] => Array
            (
                [name] => Test
                [id] => 1343143414314314
            )

    )

As you can see there is no link or no image for the actual linked profile. 如您所见,实际的链接配置文件没有链接或没有图像。

Thanks to CBroe's suggestion I got the ID from the particular post and tried all the fields for the post object. 感谢CBroe的建议,我从特定帖子中获取了ID,并尝试了post对象的所有字段。

The field story_tags ended up being the one. 字段story_tags最终成为其中一个。

It returns the following: 它返回以下内容:

"story_tags": [ { "id": "0909030339039", "name": "Name of the person or page that shared the profile", "type": "page", "offset": 0, "length": 23 }, { "id": "91238193129", "name": "Shared Profile Name", "type": "user", "offset": 33, "length": 7 }

I'm not sure what the offset and length refer to but with the id value I can finally see and have access to the shared profile. 我不确定偏移量和长度是指什么,但是我终于可以看到并可以访问共享配置文件的id值了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM