简体   繁体   中英

How to get the posts that a friend reshares using FQL?

I faced with the following problem. I would like to know how to get all the posts that has been reshared by my friend using FQL. I use the following query:

SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id FROM stream WHERE source_id=<friend_id> AND via_id LIMIT 0,100

but unfortunately it returns an empty list. At the same time, when I execute the following query for my account I get the list:

SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id FROM stream WHERE source_id=me() AND via_id LIMIT 0,100

I generated a token for all possible permissions. Could someone, please, point me how to solve this problem?

Your both queries are correct.

SELECT post_id, type, source_id, actor_id, target_id, via_id, app_id 
  FROM stream 
 WHERE source_id=<friend_id> AND via_id 
 LIMIT 0,100

It is only that, through the API, you can't access Users from depth 2 . For instance, it is impossible to get your friends' friendlist.

If one of your friends shared one of your friend's post, then you will see one result. If one of your friends shared a random user's post, then no results.

For privacy reasons, the API only allows to access the information in a quite closed circle of friends.

Yeh.. I was wondering about the question as well for some time..

Using Graph API we can get all the links that I have shared..

GET me/links?fields=link

Try this:

SELECT via_id, link_id, caption, url
FROM link 
WHERE owner={user_id}

via_id will show you the unique identifier of the original link poster. If via_id =0 you are the original linkposter.

At least it will work for links.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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