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

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.

Related

How to get total number of Tweets (just counts of tweets)

Is there any possibility to get total number of tweets (just count of tweets ) of particular user. If user X poster 10000 tweets then code return just total number of tweets not actually tweets with text or anything. I am looking for it in java.
If you have an User u you can use u.getStatusesCount() to get the total number of tweets

Identify duplicate posts in Graph API

Problem with identifying duplicate content on FB graph API.
If a photo album has been posted to the timeline more than once, the post is returned in the results multiple times with different link, object_id & post_id properties.
My code therefore can't tell that the number of likes is always n (number of duplicates) * actual_like_count.
How can I avoid counting twice?
EDIT: Here is some example data
type status_type link likes comments shares
photo added_photos a.xxx.yyy.zzz/mmm 48 6 1
photo "" a.xxx.yyy.zzz/ppp 48 1 0
photo added_photos a.xxx.yyy.zzz/ppp 48 1 19
In this example all the metrics are different, despite having the same album id (xxx).
Here is example of duplicate counts with exact same link structure
type status_type link likes comments shares
photo added_photos a.xxx.yyy.zzz/qqq 63 3 0
photo "" a.xxx.yyy.zzz/rrr 63 3 0
photo added_photos a.xxx.yyy.zzz/sss 63 3 0
Notice in the first table, the portion after slash in the link matches for the second two rows, yet still different metrics.
object_id is always different
Albums posted to the timeline will have a post_id associated with it, which will always be different, but the link to the album remains the same. You can try comparing the Links for each album.
https://www.facebook.com/photo.php?fbid=xxx&set=a.yyy.zzz.aaa&type=b&relevant_count=c
For the most part, the link will always be the same. From what I've seen, the set parameter in the link usually has a link to the album that would be the same for duplicate posts:
It usually looks something like:
set=a.xxx.yyy.zzz.zzz
The a.xxx is the album ID. You can check this by calling /xxx on the Graph API to get the album details.

How to limit contacts imported through Live SDK

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

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