Retrieve Facebook users information by date - facebook

I am using the following query to retrieve a particular Facebook users wall information:
https://graph.facebook.com/MY_USER_ID/feed?access_token=MY_ACCESS_TOKEN
Now from the above query, I need to list information which are after a particular updated_time. I am having the date in UTC format. say, 1333620660
Can you please suggest how to do so?
Thanks.

You can filter feeds by using since parameter.
https://graph.facebook.com/MY_USER_ID/feed?access_token=MY_ACCESS_TOKEN&since=1333620660
Edit (after comment):
Same way, you can use until parameter
https://graph.facebook.com/MY_USER_ID/feed?access_token=MY_ACCESS_TOKEN&since=1333620660&until=1333620890
Refer (the paging section):
http://developers.facebook.com/docs/reference/api/

Related

Is there any way to pull the latest comments and likes from Facebook?

I am saving a particular media's likes and comments in the database. I am fetching the likes and comments of the media using Graph API every 1 hour to have the latest data. But Every time I fetch the data using Graph API, I notice that there is no particular order in which the data is returned. The latest comments and likes(new ones) may be returned in the second or the third pagination which is in no particular order.
Is there any way(any particular filter which we can apply) to access the latest likes and comments(new ones) made on a particular media.
Please Advise!
You can use the since parameter to check for new feeds. Simply store the updated_time field for the most recent comment you received, and then you can use that time as the since parameter to request the next set of comments.
https://graph.facebook.com/v2.3/<page-id>/feed?fields=updated_time&since=<last comment received>

Facebook Graph API get page's comment

Using Facebook Graph API, I want to get that all comments that presents in a page and filter them based on datetime.
I've read this thread, but it doesn't help as expected.
I can get all post and limit using date for specific page e.g.:
graph.facebook.com/110432309005026/tagged?since=<unix timestamp>
Now I want to do the same to search all comments.
This is how I do so far:
graph.facebook.com/110432309005026/tagged?fields=comments{id,from,message,created_time}
But how to filter the date of comment (not the date of post) ?
For example, I want to get all comment since '2015-04-25 00:00:00' for all posts on my page.
Need your advice
You can't do what you are looking for exactly however, what you could do is also look into just filtering the posts returned by the /tagged endpoint using the since parameter.
Since you are only looking for comments from a certain date when you fetch the posts from a certain date then the comments can ONLY be from that date. Your request will look like this instead:
graph.facebook.com/110432309005026/tagged?fields=comments{id,from,message,created_time}&since=2015-04-25

Facebook Group Search post without comments

Hi,
As title, in my facebook group, I need to retrieve only post without comments.
I see the search box and notice that searching something will give an url with
`?query=Word%20Search`
and maybe there is a way to search post without comments by url.
Thanks for help!
You must use the Graph API to retrieve data from Facebook. There is example code how to get the group feed in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed#read
You canĀ“t filter by posts without comments, you need to do the filtering on your own after getting the posts.

Using Facebook Graph API, how can i get past events for my page?

Currently I can see all upcoming events:
https://graph.facebook.com/page-id/events?access_token=...
Setting the 'since' parameter to 0 does not show past events.
If anyone has successfully fetched past events through the Graph API please share.
There is an unfixed bug in the facebook graph API preventing the user from retrieving past events from pages that are not his.
In fact the only solution is to use some FQL like this:
SELECT eid, name, description, start_time FROM event WHERE creator = [pageid]
The since parameter takes a date as the value in a specific format. For example 2012-08-17T16:20:00-0500. See https://developers.facebook.com/docs/reference/api/dates/ for details on formats.
One thing of note is there seems to be a limit on how far back the API will go in returning the events but I am not sure what this is yet.

Get all latest entries in users news feed

Does anyone know of a way to retrieve the users entire news feed? Querying /me/home does filter some stories from. Also, it seems to retrieve the top stories. Is there any way to retrieve the latest stories?
It doesn't matter whether it's through the Graph API or FQL.
me/home is pulling posts in order of created date on my end
https://developers.facebook.com/tools/explorer/135669679827333/?method=GET&path=me%3Ffields%3Dhome.limit(20).fields(created_time%2Cupdated_time%2Cid)
try this as your query, you can mod fields to include any you need.
me?fields=home.limit(20).fields(created_time,updated_time,id)
if it is still out of order because of your cookie settings from the actual home feed, you can force it to reorder by passing the array in sort(); "php".
for sort() refer to: http://php.net/manual/en/function.sort.php