facebook application invite incentive
I'm trying to make a facebook game that allows users to invite friends. I'd like to provide an incentive that people who invite others get 1 bonus point for every 10 points that their invitee gets. I'm developing the facebook app on Google App Engine using the Python runtime.
What is the best wa开发者_开发知识库y to implement this kind of feature? I know that I can find out who invited a given app user. I want to account for a lot of users and want to conserve as many server resources as possible.
I was thinking to create a 'User' entity, where there is a 'id' value, a 'points' value and a 'referred from' value. When points are added to for a user, the server looks up the 'referred from' entity and awards points accordingly. But since I am only awarding 1 point for every 10, it might be a waste for the server to check every time whether points mod 10 is 0. Also, if invitation points are carried through, it seems like the entire User datastore namespace would constantly be propagating points, which is also wasteful.
Any good way to implement?
One way to do this, as you observe, is to update the parent entity every time the user earns a total of 10 points. If they only earn one point at a time, the maximum overhead for this is 10%.
A more efficient option might be to set a flag whenever a user earns points, and once a day, run a mapreduce or other similar job that sums up all the points for a user's referrals who have that flag set and adds it to their total.
This is against faecbooks platform policy
App does not directly reward or require users to use Facebook Social channels, such as Feed stories and Requests.
精彩评论