FQL for finding news

I have a strange problem with the application that I am developing. I am using the PHP SDK to call the Graph API on the server side, and here is my code that calls the API:

$params = array('q' => 'George', 'limit' => 100); $newsfeed = $facebook->api('/me/home', 'GET', $params); 

And here is the following code to display HTML news. I have a footer below that once clicked downloads further posts. But I noticed that in the case of a news search using the additional parameter "q" we do not get results in one week.

Now I am giving a second FQL attempt instead of the Graph API. The good thing with the Graph API was that adding the q parameter to / me / home will automatically search and you have nothing to do. But with FQL, this does not seem to be the case as shown in the following documentation:

http://developers.facebook.com/docs/reference/fql/stream/

My idea is to use the following FQL:

 SELECT post_id, actor_id, target_id, message, comments, likes FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me() AND type = 'newsfeed') AND strpos(message, 'facebook') >= 0 

Any ideas on how to implement a search? I really want to imitate the news channel in the application, so please enlighten me about the batch processing of several FQL queries if you have ideas on this.

+4
source share
1 answer

try setting source_id = me () as follows:

 SELECT post_id, actor_id, target_id, message, comments, likes FROM stream WHERE source_id = me() AND strpos(message, 'facebook') >= 0 
+1
source

Source: https://habr.com/ru/post/1338289/


All Articles