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

3

6

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?

Pillory answered 11/9, 2010 at 20:23 Comment(1)
It must be possible from the point that everything what the browser does is either JS or sending some HTTP request to a receiver.Pase
K
5

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.

Katinka answered 19/9, 2010 at 21:31 Comment(2)
The idea is not to like my application.Pillory
You can like posts using the graph api, but your app needs to be whitelisted!Spanner
T
6

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

Teresitateressa answered 11/9, 2010 at 20:29 Comment(3)
Yes, it's for a "auto-like" when some conditions are met, all this is configurable and the user can completely disable it if he wants. I don't want to like a post within Facebook though, I want to like something on a different page, if you must know, I'm talking about IMDb movies.Pillory
look at this thread: forum.developers.facebook.net/viewtopic.php?pid=227438Papillote
Denis, your link is broken now. FYIPolemic
K
5

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.

Katinka answered 19/9, 2010 at 21:31 Comment(2)
The idea is not to like my application.Pillory
You can like posts using the graph api, but your app needs to be whitelisted!Spanner
W
1

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

Willy answered 18/1, 2011 at 13:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.