I am getting wall posts by facebook sdk
$get = $facebook->api('/me/posts', 'GET' );
or
$get = $facebook->api('/me/feed', 'GET' );
I need to save them into my own DB, and after new request, I need get posts, that I have not saved yet. But I could not find any parameters to add to get info for example last 7 days, or after post by timestamp smth.
I saw that there is FQL which has time field, but it was only in Statuses table, I need all of them, likes, shares, statuses, comments etc.
Can anyone help me?
You can add since=[time] and/or until=[time] as query strings to get a specific slice of time.
For instance, to get 7 days of posts beginning on October 1, 2012, try this:
'/me/feed?since=2012-10-01&until=2012-10-08'
Your time string can be either an ISO-8601 date string or a UNIX timestamp.
Related
When I call the /statuses endpoint I only get a updated_time field and not a created_time field (like I do when calling /photos or /links). It seems that updated_time is the time this post was last liked or commented, and it appears even setting the since parameter in the query returns statuses that were created before since but were updated after.
Is there any reason for this difference between /statuses vs. /photos and /links?
Can I get a created_time for a status and query since accordingly?
Better use FQL for this time. It has always been more complete than Graph.
SELECT time, message FROM status WHERE uid = me()
time uid
UNIX timestamp of the date and time the status message was posted
https://developers.facebook.com/docs/reference/fql/status/
Where can I find the documentation (parameters that can be given) of the following graph url:
https://graph.facebook.com/<PAGENAME>/feed
I've been searching for hours, but I can't find them.. I'm looking for the parameter to get posts till a certain date..
What you are looking for is Time-based Pagination to navigate through results data using Unix timestamps which point to specific times in a list of data. You can use the until field which as per documentation is
A Unix timestamp or strtotime data value that points to the end of the range of time-based data.
For example, following will give you the posts of User until 10th June 2013
me/feed?until=1370840400
In looking at the stream table, the documentation says ..
updated_time time
The time the post was last updated, which occurs when a user comments on the post, expressed as a Unix timestamp
created_time time
The time the post was published, expressed as a Unix timestamp
However, when I execute a FQL query against the table I see
<created_time>1328136721</created_time>
<updated_time>1328136721</updated_time>
even though 700+ comments have been made on the post. Given the documentation, if a comment has been made on a post, I don't see how the 2 timestamps can ever be the same.
The bug seems the appear for status with 30+ comments, as per this bug report. It is currently marked "Assigned".
How can I get the number of FB shares/likes for some FB object over a time period?
For example, I'd like to get how many shares where for some url from January, 1st, 2011 until January, 30th, 2011.
There is the link_stat table:
http://developers.facebook.com/docs/reference/fql/link_stat/
but I don`t think there is any timestamp there, or anywhere in the facebook database.
What you can do is query this table and save the stats in your DB at the beginning and end of the period, and compare the values.
I'm trying to do the following Facebook Query Language query:
https://api.facebook.com/method/fql.query?query=SELECT name FROM user WHERE uid IN (SELECT actor_id FROM stream WHERE app_id = 131580206909839 AND xid = 'daily_thred_production' AND created_time > 2011-03-06 AND created_time < 2011-03-08)
The problem is that the dates aren't being recognized and I can't find any documentation on how to format FQL dates from the Facebook developer section. Any thoughts?
EDIT
I'm doing all of this from the URL with no programming language. I'm just trying to pull one-off statistics for some co-workers.
Epoch time seems to work, thanks! Only problem is that it's only displaying new users that contributed to the stream for the first time. Unfortunately I'm trying to find everyone in the stream, I'll have to look at the stream table more carefully.
Thanks Brian.
They're epoch time (Number of seconds since 00:00:00 Jan 1, 1970 UTC)
You need to convert your dates to epoch time in whatever language you're using.
EDIT: If you need an example, let me know what programming lang you're using.