Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically "press" a 'Like' button through a Facebook Application?

I'm developing this Facebook Application and I was wondering if it's possible (and how) to programmatically, through the Facebook PHP Graph API, press some 'Like' button on some page?

Of course, this is optional on my application... I'm still not ready to really explain what application I'm doing, but it would be interesting to code such a feature.

Is it possible somehow?

like image 889
rfgamaral Avatar asked Sep 11 '10 20:09

rfgamaral


People also ask

How do you hit the like button on Facebook?

Tap or click the thumbs-up icon below the thing that you want to like. Doing so will "Like" it, which alerts the person who posted it that you liked their post. To revoke your like, just tap or click the Like button again.

How does the Facebook like button work?

When a user clicks the like button, the content appears in the News Feeds of that user's friends. The button also displays the number of users who liked each piece of content, and may show a full or partial list of those users.

What happened to Facebook like button?

"We are removing Likes and focusing on Followers to simplify the way people connect with their favourite Pages," Facebook said about the redesign. The notable changes include a redesigned layout, News Feed, easy navigation, updated task-based admin controls, actionable insights, and safety features.


3 Answers

By your description it sounds like you're trying to get a user to like something without the users knowingly clicking a like-button. This sort of interaction is not condoned by Facebook, I think. There are various black-hatty ways to accomplish this though, one fairly elaborate one is descriped here: http://www.liquidrhymes.com/2010/08/25/smoking-hot-bartender-is-some-smoking-hot-facebook-spam/

UPDATE Sorry, I might be wrong. If you get stream_publish extended permissions from the user, you might be able to like posts on their behalf by doing a POST to /POST_ID/likes. See Publishing to Facebook in http://developers.facebook.com/docs/api

like image 101
friism Avatar answered Nov 04 '22 11:11

friism


You cannot do this. Facebok wont let you do a POST to /POST_ID/likes, you can only do a get request to retrieve their likes. What you are trying to do is a violation of facebook's TOS. I would suggest just adding a like button and "forcing" them to like before they continue with your application. However, in my opinion even that is kind of silly because they can instantly go unlike it after they have used your application.

like image 32
Nathan Totten Avatar answered Nov 04 '22 11:11

Nathan Totten


i was looking for the same thing, but not to force a user into liking something, but actually for their own protection.

here is where i come from: on a web site (maybe on multiple pages) there is an "I Like" button, implemented as described by facebook.

each time a user goes to that page, the browser will make a request to facebook, throught the iframe that contains the button, providing all the info that we are used to from a web server log file.

if the user has in the past logged in facebook and not cleared the cache. the request will also contain the cookie indentifying the facebook user.

so even more then analytics, facebook know all about the user activity on those pages.

so i wanted the user to only give this info when they decide to.

my solution was to have a button (as graphic only) on the page. when the user clicks it a new frame should open and only there the facebook code should be executed.

obviously on the new frame i could not put the normal "i like" code, since that would require a 2nd click for the user. at this point i would need the "programmatically clicking of the i like button".

it is not an opengraph solution, but it works: the frame just does a redirect to http://www.facebook.com/share.php?u=URL

like image 30
memical Avatar answered Nov 04 '22 09:11

memical