How to detect the Facebook Like button and click the trigger button?

Here is an example:

These guys force people to click the Like button (in the first step) before allowing the user to upload the video in step 2.

Interestingly, the โ€œNamesโ€ button was detected and the page refreshed to show a blurry image in step 2 so that the user can click to load.

And it seems like I remember that I click โ€œLikeโ€ (when I reload the page), so the โ€œLikeโ€ button is no longer displayed and it only shows step 2.

What is their trade trick?

+4
source share
5 answers

When the Facebook tab is loaded, the fb_sig_is_fan parameter is passed when it indicates whether the current user viewing the tab is a fan. Pressing the โ€œLikeโ€ button will reload the contents of the tab, as a result of which the updated fb_sig_is_fan file will be transferred so that the application can display another image.

+3
source

In fact, information if the user is a fan of the page or does not exist in the signed request. Since you need to decode the signed request first, as it is here:

$signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); 

And after this access page I liked the variable:

 $pageLiked = $data['page']['liked']; 

Now FB is on the path to obsolete FBML, so don't consider <fb:visible-to-connection> as something that works for a long base.

+3
source

http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

 FB.Event.subscribe('edge.create', function(response) { // do something with response.session }); 
+1
source
 <fb:visible-to-connection> put here code for users that like the page (no <fb:comments>) </fb:visible-to-connection> 
0
source

You can determine when the user clicks on the button using edge.create . Also, if the user already liked the page, it can be detected using the FQL Like table.

0
source

Source: https://habr.com/ru/post/1338241/


All Articles