I'm hoping to mimic Facebook's "Like" feature using Flag module. This is so that I know which nodes have most likes (using Facebook's Like plugin doesn't give me such data.)

The implementation is not an issue. But I also wonder if there is a way to publish on user's Facebook, each time when someone Like (flag) a node.

Has anyone tried something similar?

Comments

quicksketch’s picture

This is possible but a bit round-about how it would need to be implemented. Facebook's newer APIs prevent you from ever performing anything on behalf of the user without explicitly asking for permission to do so. The end-user only needs to grant permission to your website once, but your site will still have ask Facebook for the ability to post something to their profile every time they flag a piece of content.

So implementation-wise, I think you'd essentially need to have two approaches to Flagging. If the user has approved the ability to post to Facebook you would actually link *directly to Facebook* to perform the Flagging there, then on the return page also Flag the content locally. This handles the problem of needing to request Facebook access before every flagging. Of course doing this through AJAX would be an additional layer of trickery, so I'd probably recommend just a non-AJAX approach for starters. If the user has not granted you permission to access their Facebook information, you'd just show the normal Flag link that operates locally-only.

deanloh’s picture

Status: Active » Fixed

I have got the solution for this. See: http://drupal.org/node/1130232

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.