How to count number of shares by specific user? - facebook

I would like to run a contest among the users of my Facebook app and provide a prize to the users who share it the most time.
How do I get the number of shares performed PER user to my FB app? I will probably do it via PHP, but I'm pretty flexible with other platforms.
I know that I can use something like: http://graph.facebook.com/?id=YOUR_URL, but I want the number of shares per user and not the total shares of my app.
Thanks

Related

Facebook Rate Limit, what counts as an active user?

I have a website that makes a call to Facebook to see how many times certain links have been shared but i'm wondering about the Rate Limit. I'm trying to estimate the rate limit my site has, according to the official documentation the rate limit is calculated like this:
The number of users for your app is calculated as the average number
of daily active users plus today's new logins as an estimated value.
Apps with a larger number of users may have more accurate rate
limiting than apps with a smaller number of users. Apps with a very
small number of users may have rate limit issues.
But what counts as an active user? everyone that makes a call to the API through my site/app? everyone that visits the site/app and is logged in to Facebook?
Active Users are users who are interacting with your APP (what means that they are making some kind of API calls) It doesn't matter if they are logged into FB when they are using an active access token.

How to get tier 2 friends or "people I may know" from Facebook API?

Using Facebook API, how would I go about finding people on Facebook, that are friends with a lot of my friends.
You see it in the sidebar as People You May Know, and it shows some people that are friends with a lot of your friends. Like: "Do you know John Smith? 65 mutual friends".
How do I generate a list of say 100 of these top tier-2 friends that have also authorized my app?
The only way it would work is if you stored your users friend lists, all of your friends used your application and all of their friends used your application. You can only retrieve a list of current friends who use your application. If (somehow) you managed to fulfill the requirements I stated, however; you could simply compare the friend lists you've stored to one another and see which friends are not on your list but are on others. It's not exactly feasible, though, because every one of them would need to authorize your application.

when will be best time to pull Facebook friends?

For my iPhone app, an user can logged in using Facebook, then the app can get list of friends that already on the app. Now I am wondering - when should the user's Facebook friends be pulled down. Should it be the time when the user start using the app and login with Facebook? Or should it be done periodically in the background thread? Or should it actually be done on my apps' web service side (with the access token received and sent over from the iPhone app) What's the best practice to go with?
The main concerns are
total # of friends could be a large number, which would require a lot of network traffic
time processing
A couple of options:
From your comments below your question, cache friends lists for a minimum of 24 hours. Friend listings rarely change often (unless the user is under 25 years of age, then it might change more frequently...statistically speaking).
Another option you can also subscribe to a user using the Real Time API. Store their friend information on your server and when Facebook tells you they've added a new friend you add it to your data store. Then you can query your own server rather that hitting the Graph API.

How do I check my limits on publish_stream?

Let's say a user selects 50 facebook ids that are his friends.
I take each facebook id and post a message on each person's wall. (Making 50 publish_stream api calls)
What is the limit for Facebook? How do I check how many I can post on behalf of the user?
There is no longer a limit on doing this. But in my company we stopped practicing publish_stream at all after Facebook banned 3 applications using this and we had to make long conversations with them. It's written nowhere on what basis but there is definetly an algorithm catching applications that publish a lot.
When we did that I found many comments on different limits. It seems that it all depends on the application history. This means, if your applicatin is new and generates many streams in the first day it will be caught as spamy. If the app has long history and large user base you can afford that.

How to display a list of Facebook users registered with my Facebook Connect website

I'm developing a website using Facebook Connect as the only membership/authentication mechanism.
So far authentication and inviting friends work.
Now I'd like to display a list of users registered with my Facebook application. Something like : "There are 1234 members in the AppName community" + a list of profile pictures.
How would I do that ?
Thanks !
This is actually pretty easy to do. After each user connects with your site through Facebook Connect, create an entry for them in some user table (which you're probably already doing). Then when a user logs in simply display the total number from your users table and randomly select 10 user IDs (or whatever number of pictures you want to display) and show them using the FBML <fb:profile_pic> tag http://wiki.developers.facebook.com/index.php/Fb:profile-pic.
There is some metric information available about your application via the Admin.getMetrics API call. I believe it only provides the number of active users within a certain time period however.
The actual total number of users is difficult to track due to people who remove the application, or might have it installed but blocked. I don't think it's available as a specific property anywhere. The information pages about Facebook apps never show the total number of users, only the monthly active users, which is what Admin.getMetrics() can tell you.