get shared links on facebook newsfeed

2019-05-31 13:01发布

I want to retrieve all the links shared on my wall using graph/fql, is there a way to get these

I am using fql query using friend list but that is not working, taking too long to respond.

3条回答
孤傲高冷的网名
2楼-- · 2019-05-31 13:54

In addition to genesis' post, you may want to look for links in messages as links posted directly as statuses on your wall do not have a 'link' field. You will have to extract the links yourself however which may require knowledge of regex or blind trust of solutions posted here.

查看更多
Emotional °昔
3楼-- · 2019-05-31 13:58

The Graph API Explorer is a good place to look for these. You want /me/links to access the Link object. You'll need an access_token from an authorized user who has granted the read_stream permission.

查看更多
4楼-- · 2019-05-31 14:08
<?php
$json = (array) json_decode(file_get_contents("https://graph.facebook.com/me/feed/?access_token=".$access_token_here));

foreach($json['data'] as $item){
   if ($item->link){
       $links[] = $item->link;
   }
}

print_r($links);

returns

Array
(
    [0] => http://youtu.be/r0a-o16i_Gw
)
查看更多
登录 后发表回答