How to limit contacts imported through Live SDK - rest

Can we Set a limit on the number of contats returned by Live SDK?
https://apis.live.net/v5.0/me/contacts?access_token=xccxxxx';

Use the limit parameter with the number of the results you want.
So to limit the results to 5 in your example that would be:
https://apis.live.net/v5.0/me/contacts?limit=5&access_token=xccxxxx

Related

Count Unique Values in Found Set

Firstly please allow me to explain what I am trying to achieve. I have a found set of about 100 records, each record has a SKU number (serial) now out of the 100 records, some records have the same SKU, so of course there is less than 100 unique SKUS.
I want to know how many times a SKU appears within the found set. NOT the total number of unique SKUS, but more like how many times each SKU appears individually.
So for example I could have the SKU - 123456 - which appears twice in the found set, so the value for that should be 2, as there are 2 instances of that SKU in the found set.
So just to reiterate, I do not want the total number of unique SKU's in the found set, but more to know how many times each individual SKU appears within the found set.
I have tried many things but keep ending up with the total unique values which is absolutely no use to me.
Thanks
Building on michael.hor257's idea, you can use the GetSummary function to achieve your desired result.
Sample field definition:
After sorting your found set on SKU, this will produce the following result:
use ExecuteSQL filemaker native function to achieve this easily. here is FileMaker article that gives a very good insight:
http://help.filemaker.com/app/answers/detail/a_id/3423/~/counting-the-number-of-unique-values-in-a-field

How to obtain the total number of photos in one area using the panoramio data API?

I am trying to get the total number of photos from one specific area using the panoramio data API.
The following code
www.panoramio.com/map/get_panoramas.php?set=full&from=0&to=0&minx=-180&miny=-90&maxx=180&maxy=90&mapfilter=false
returns
{"count":72543250,"has_more":true,"map_location":{"lat":-46.647137999999998,"lon":-72.607527000000005,"panoramio_zoom":0},"photos":[]}
count should be around 100 000 000 (the total number of photos in panoramio) and not 72 543 250 and I guess the value of "has_more" should be false.
Thanks in advance.
The difference between the total number of photos according to the API and the actual total number of photos in Panoramio is that the API only returns geo-referenced photos and not all photos in Panoramio are geo-referenced.
The 100,000,000 are recent ID, because some ID are deleted, so REAL number may be lower.

Maximum number or results from a FQL query

Is there a limit to the maximum number of results (considering selecting only a field from a table - ex: uid from users) one can get with a single FQL query?
Ex: select uid from users where condition has a 1M sized results set -> how many of those 1M would be returned to the caller?
According to a blog post made by the Facebook on same issue the limit stands at 5000 results before the visibility check kicks in reducing even further the result set.

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.

How do I call more than 100 statuses with Facebook API?

I'm building a Facebook application and I want it to be able to read all the user's statuses from the past year. When I make the API call, I can only retrieve the first 100 statuses no matter what I set the limit to.
Here's the URL I'm using to make the call:
https://graph.facebook.com/me/statuses?limit=100&access_token=...
When I set the limit lower, it shows fewer statuses (proving that the limit argument works). When I set the limit higher, it only gives me the first 100. When I use 'since', it still only gives me 100.
When I use the 'next' url it gives me, I see no data past the first 100 statuses.
I know it's possible to get much more than that because of applications such as My Year In Status
It does work. You must use both the limit and offset query parameters. The limit parameter sets the batch size. The offset parameter sets the position in the user's all-time status collection. Without specifying the offset parameter, Facebook defaults it to zero, which is why you keep seeing the same dataset.
For the 1st batch of 100 statuses, set limit to 100 and offset to 0.
For the 2nd batch of 100 statuses, set limit to 100 and offset to 100.
For the 3rd batch of 100 statuses, set limit to 100 and offset to 200.
For the 4th batch of 100 statuses, set limit to 100 and offset to 300.
And so on...
Keep iterating until you get an empty dataset:
{
"data": []
}
I've verified using the Graph API explorer that the pagination is not working as you have described. Log it as a bug with Facebook at: https://developers.facebook.com/bugs and post the bug # here.
EDIT
Per the bug closure, the 100 limit is By Design and you won't get more than that, meaning that Facebook has made a conscious business decision to limit the amount of data it has to store, process, and serve from the Graph API. It costs money to do so and since the API is free to use, I can't argue with them. However, if I was paying for it, then hell yes I kick and scream all the way down the road.
Paging and Since, Until parameters not working for me too.
But I found out, that I'm able get more then 100 statuses using Offset parameter.
Here is my code using Facebook C# SDK:
var fb = new FacebookClient(accessToken);
string connection = "statuses";
string urltemplate = "https://graph.facebook.com/me/{0}?limit={1}&offset={2}";
int limit = 25; //items on one page (Max is value 100)
int offset = 0;
var statuses = (IDictionary<string, object>)fb.Get(string.Format(urltemplate, connection, limit, offset));
while (statuses != null && statuses.ContainsKey("data") && ((Facebook.JsonArray)statuses["data"]).Count > 0)
{
var dataItems = (Facebook.JsonArray)statuses["data"];
foreach (Facebook.JsonObject item in dataItems)
{
//TODO: process item data
System.Diagnostics.Debug.WriteLine(item["message"]);
}
offset += limit;
statuses = (IDictionary<string, object>)fb.Get(string.Format(urltemplate, connection, limit, offset));
}
This worked as of a week ago, our best bet to get this fixed is to post on http://developers.facebook.com/bugs/155458081230560 so the facebook developers know how big of an issue this is.
Facebook closed the previous bug without really testing to see that it didn't work. I've made a new bug here: https://developers.facebook.com/bugs/242235199184053