Show Content After Facebook Like - php

So is there any working code in HTML/PHP that makes certain content () available only after the user clicks the "Like" button.
It's not an app, just an external website.

There is a callback when a Facebook button is 'liked' using Javascript
It's documented here
http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
The event is called edge.create by the looks of it.

There is no way to achieve your desired result - unless the user in question is also authenticated via facebook on your site, but I don't think that's the case.
The js like callback will (being a callback) only work after the user clicks like.
The thing you'd like to do is only possible within facebook pages' iframes, that are called with a signed request containing the current user's facebook id.

Related

Make facebook notify if an URL has hit a like or share

I am developing a web+app system and I would like to know if there is any way that Facebook tells me how many likes has an URL I post in a user wall.
What I would like is that when some users hits like, a GET (or POST) Request to my server is called so I can store the external hit in my database without having to update it every time.
Does it even exist?
Maybe FB.Event.Subscribe can help you?
From the docs:
FB.Event.subscribe allows you to define callbacks that will be called
when certain events take place on your site. These events include:
Logging in or logging out via Facebook Login
Someone likes or unlikes a page via an embedded like button
Rendering of social plugins
Comments are added or removed
Someone sending a message to your page or a friend via an embedded send button

Facebook graph API - liking a Facebook page; can be achieved with correct authorisation?

So I've read up about this everywhere, and the general consensus is that you are unable to like a Facebook page using any kind of API (but you can now like external pages via the graph api, as well as pages that link through to Facebook pages it would seem, e.g. I can create a like on here: http://facebook.com/40796308305).
However, while doing this research, I heard 'rumours' about apps being given the authorisation to like Facebook pages via oAuth or the graph API. Does anyone know this to be true?
Essentially, I have a page where a user must click on the 'like' button of a Facebook page, and then click a button to confirm they have liked it. The back-end then uses then authenticates the user for the app, and checks to see if the like exists on the page. If so, then a new page loads up. If not, they are redirected and asked to ensure they have clicked the like button.
Effectively, I would rather this process be done by telling the user that clicking the button will cause them to 'like' a Facebook page, and do it in one process.
Looking at the graph API, I could create a new 'action' to achieve the same effect, but as I understand it, unless they 'like' the Facebook page, they won't see posts from the page on their timeline.
Does anyone know if any 'rumours' of authenticated apps are true? If not, then what I'm talking about is probably not achievable; but I thought I would ask here first. Just trying to get a final word on the matter.
On a side note; if likes are not possible for pages, is there a way to generate an action, that also subscribes to a pages feed?
Cheers.
Essentially, I have a page where a user must click on the 'like' button of a Facebook page, and then click a button to confirm they have liked it. [...] Effectively, I would rather this process be done by telling the user that clicking the button will cause them to 'like' a Facebook page, and do it in one process.
Then why not just embed the JS SDK, and subscribe to the event of the user clicking the like button …? When you receive the event, then you can reload your page automatically via script.
For the rest of your question: TL;DR, and also not here to discuss “rumours”, sorry.

Facebook Multi request

I would like to embed the facebook request form on the fan page without asking for permission, is it possible that the friend selector does not popup but instead displayed on the fan page?
The problem I am facing is
As I do not want to bother user for permissions I do not have the Current UserId, which I need for computation of who send how many request
Do not want the app request to popup
Do not want to use the fbml as it will get deprecated by June 2012
Any help how can I do this using PHP?
As you say yourself, you need the current user id. I'm sure you can get this without permissions along with other basic data such as name and gender etc.
try:
https://developers.facebook.com/tools/explorer/?method=GET&path=YOURUSERIDand you'll see.
As for showing the multi-friend selector in the page rather than as a popup, I've not done it myself but usually you can specify the display parameter, e.g. &display=page (rather than display=popup
Also, I think you have to use the JS SDK to do this and not PHP:
http://developers.facebook.com/docs/reference/dialogs/requests/
Also, if you want to send notifications to your user's friends then you will require permissions to do so.

Facebook php login status

I'm trying to do something similar to the login/registration flow described on this page but via php only.
http://developers.facebook.com/docs/plugins/registration/
What I want to do is display a register link if a user is logged in to facebook but not registered with my site, and a login link if they're not logged in to facebook, however I want to do this all on my side in php, and not using the fb:login-button widget. Is this possible?
I have the login url working, i just want to change the name of the button based on the users status.
You can't do it without loading the javascript lib. If you load nothing from Facebook on the client, then there is no way to do cross domain communication (security). Which means there is no way to tell who the user is, much less if they are logged into Facebook. By loading the javascript API on the client, the javascript code can check for a Facebook cookie and determine who they are and whether they are logged into Facebook or not.
Check through javascript and do a page reload if need be. Better yet, just use css to show/hide what you want.
http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
Yes, it is possible. Here's a tutorial:
Tutorial,
Example tutorial

How to get notification when someone likes or comments via Facebook Social Plugin

I have integrated the Facebook Social Plugin into my Joomla Website.
I have a Like button and a Comment box.
How can I get notified when someones Likes the page?
How do I view a list of users who Liked the page?
How do I get notified when someone comments on the page?
Are you using XFBML or an iframe to implement the Like button? I If you're using XFBML, you can give Facebook a callback function whenever an event happens through Facebook. When someone 'likes' your webpage, Facebook generates an event called 'edge.create', as listed here.
You can get some information from your users via http://www.facebook.com/insights.
Similarly, when someone comments on your page, a 'comments.add' event is fired.
There's more information about the Facebook 'like' button in Facebook's own documentation.
Edit:
Judging from this passage found in Facebook's documentation :
The XFBML version is more versatile, but requires use of the JavaScript SDK. The XFBML dynamically re-sizes its height according to whether there are profile pictures to display, gives you the ability (through the Javascript library) to listen for like events so that you know in real time when a user clicks the Like button, and it always gives the user the ability to add an optional comment to the like.
It doesn't seem to be so.

Categories