Storing FB likes in database
I'm working on picture contest site which have to allow user to vote with facebook like button. At the end of a round, a have to check all picture likes and store it in our database. Well, what's proper way of doing this? How can I use links.getStats f开发者_如何转开发unction for getting that data and storing it in the database?
Similar question is found here: How can I store the number of facebook Likes of a particular url in my own database? but it isn't answearing my question because I have to get exact number of likes/votes in short period in time.
I'm using ASP.NET MVC but any other solution should be fine.
Use a js callback to record the like button clicks (probably via an ajax call back to your db).
FB.Event.subscribe('edge.create', function(response) {
// do something with response.session
});
See https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ for more details.
精彩评论