get shared links on facebook newsfeed

怎甘沉沦 提交于 2019-12-08 07:34:09

问题


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.


回答1:


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.




回答2:


<?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
)



回答3:


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.



来源:https://stackoverflow.com/questions/7179944/get-shared-links-on-facebook-newsfeed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!