Querying old links from public Facebook page returns an empty set - facebook

I am trying to fetch links that were posted on a public Facebook page sometime ago, in 2011 for example. Specifically, the Arabic CNN page on facebook: http://www.facebook.com/CNNArabic
Things I tried:
1- Graph API, a query like this:
CNNArabic/links?fields=id,name,link,created_time&limit=25&until=2012-05-15
2- FQL
SELECT link_id, url, created_time FROM link WHERE owner = 102581028206 and created_time < 1337085958 LIMIT 100
Both give an empty data set while there is data on the page on or before this date.
Other things I noticed:
1-If I changed the date to something like 2013-01-17 (which is yesterday), it works fine.
2-If I changed the date to something like 2012-12-17 (about a month ago), an empty data set is returned, however if I followed the next page links in the returned data set from the query in number 1 above until I pass by this date I actually get data.
I tried writing code that kept following the next page pointers until I reach the links on the date I want. However I need data much older (say in 2011) and the result set gets exhausted say 2 or 3 months earlier than now, in other words no more next links are returned so I actually can never reach that old data.
To cut this short:
is there a way I can query links that were posted on a public page before a specified date?

Querying the page's feed works in the Graph API:
/102581028206/feed?fields=id,link,name,created_time&limit=25&until=2012-05-15
This returns all the posts. There should be a way to filter this using field expansion, but I couldn't get the few things I tried to work.
You can get this filtered for links only with FQL on the stream table:
SELECT message, attachment, created_time FROM stream WHERE source_id = 102581028206
AND created_time < strtotime('2012-05-15') AND type=80 LIMIT 10
Links are type=80.

Related

Getting all Tweets from a User, after a certain date

You can get all tweets for a user: via the getUserTimeline() method.
You can also get all tweets after a specific date: sinceId() method.
But I want to combine these two. I want to get all tweets from a certain user, but only those tweets which were posted after a given date. Any ideas on how to do this?
I don't understand why you need sinceId(). getUserTimeline() returns a paginated list of Statuses. For each status in the list, doing status.getCreatedAt() returns a Date which is a Comparable. You can easily compare Date instances with each other and determine if a Date occured after another Date.
I wound up just using the id of the tweet, as a marker for the date. I didnt care about the date per se, but simply whether the tweet was before or after the previously loaded tweet. The docs suggest that the id is a more or less reliable indicator of recency. I.e., id 1234 is most likely to be a tweet that was posted before id 1233.
Thanks!

Get home feed of a particular user of a specific time stamp using graph API

I am trying to build a Facebook application by using Facebook Graph API. I am trying to get the home feed of the application user for a particular time span. e.g. From 11-02-2014 to 15-07-2014. I have used since and until in Facebook Graph Explorer but it returned news feed of two consecutive days.
2011-01-01 is the wrong synthax to represent a time on Facebook. You should use Unix timestamps: 1418971177.
A time-paginated edge supports the following parameters:
until : A Unix timestamp or strtotime data value that points to the end of the range of time-based data.
since : A Unix timestamp or strtotime data value that points to the start of the range of time-based data.
limit : This is the number of individual objects that are returned in each page. A limit of 0 will return no results. Some
edges have an upper maximum on the limit value, for performance
reasons. We will return the correct pagination links if that happens.
Source: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#
So, instead of:
/me/home?since=2011-01-01&until=2011-05-05
You must use:
/me/home?limit=25&until=1418971177 with until.
Or:
/me/home?limit=25&since=1418971128 with since.
Note that you can't use since and until together. You have to use the limit field to restrict the amount of results you get.

Range query with no dups

I have a collection that I would like to serve out as 'pages'. The collection could get quite large, I have read skip is not optimal in that case. I think range queries will work just fine in my case so I am going to try that route.
My collection will be sorted and paged on a timestamp field. I have implemented the API such that a user passes in a startDate and I will return a certain number ('limit', max of 1000) of items. However I am struggling with how to not get duplicates on each page if documents have the same time.
As an example (small page size to make it easy).
I have 6 documents let's docs 3 and 4 have the same time. If I ask for page one I will get the first three. However when I ask for page 2 with a startDate that it 'gte' the last doc on page one I will get a dup on page 2 as the last doc from page one will be that same as the first doc on page 2.
I cannot find a range query example anywhere that deals with dates, while not returning dups.

How to Sort/ Limit the API call for Groups for member list

I see that we can only get 500 members of a group using the graph API.
and the doc says these are "the first 500 members",
Are these sorted by date signed up, or latest 500?
Is there any way I can further limit these to signed up in the last 24 hours/ 1 week?
Is the 500 limit there in using FQL also? (the docs don't specify that )
Is there any way I can further limit these to signed up in the last 24 hours/ 1 week using FQL?
i see that we can only get 500 members of a group using the graph API. and the doc says these are "the first 500 members",
are these sorted by date signed up, or latest 500,???
I’d say by date of joining the group, because otherwise calling them the “first” 500 would make little sense.
Is the 500 limit there in using FQL also? (the docs dont specify that )
From my tests there seems to be no such limit on the group_member table (just tried it for the FB developer group using Grapf API explorer, and my browser froze for about a minute loading the data).
is there any way i can further limit these to signed up in the last 24 hours/ 1 week using FQL?
No, there is no such info as signup date in the FQL table.

get number of updates since a timestamps in facebook

Can we get the number of updates since a particular timestamps using graph APIS? Number of updates might be number of new New feed or Messages.
depending on which api you are calling
When searching for public posts or posts on the user's News Feed, you
can page over the results by using the since, until and limit
parameters. since and until both accept a unix timestamp. When paging
back in time, you should use until in conjunction with limit where
until is the unixtime value of the created_time field in the last
object returned by your previous query. When paging forward in time
you should set since to be the unixtime value of the created_time
field in the first object returned by your previous query. Please
note, you can only search about 1 to 2 weeks back in the News Feed.
/me/feed?since=2+hours+ago&until=now "using strtotime in php"