1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[HOW-TO] Setup a "Must share before..." page!

Discussion in 'FaceBook' started by auuuu, Feb 25, 2012.

  1. auuuu

    auuuu Elite Member

    Joined:
    Jul 10, 2010
    Messages:
    1,534
    Likes Received:
    349
    Occupation:
    Social Influencer
    Location:
    England
    Hope that this little tutorial can help someone to make some bucks from it ;)

    - Create an index.php

    And copy this:

    Code:
    <html>
    <head>
    <title>TITLE OF YOUR WEBSITE/PAGE</title>
    <script type="text/javascript">
    <meta property="og:title" content="[COLOR=Red]TITLE OF YOUR WEBSITE/PAGE[/COLOR]" /> 
    <meta property="og:type" content="website" /> 
    <meta property="og:url" content="[COLOR=Red]http://www.yoururl.com[/COLOR]" /> 
    </head>
    <body>
    
    <div id="fb-root"></div>
    <script> 
      window.fbAsyncInit = function() {
        FB.init({appId: '[COLOR=Red]INSERT-HERE-YOUR-APP-ID[/COLOR]', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    
    <div id="share"><a href="#" onclick="share()">[COLOR=Red]SHARE To Unlock[/COLOR]</a></div>
    <div id="reserved" style="display:none">[COLOR=Red]CONTENT-AFTER-SHARE[/COLOR]</div>
    
    <script>
    function share(){
        FB.ui({
            method: 'stream.publish',
            message: '',
            attachment: {
                name: '[COLOR=Red]Title on the post that will be published[/COLOR]',
    <!-- About caption: Now is set for share things like "Michael has just found how to bla bla bla. -->
                caption: '[COLOR=Red]{*actor*} ha just found the way to...[/COLOR]',
                description: '[COLOR=Red]Description of your website or whatever you want![/COLOR]',
                href: '[COLOR=Red]http://yoururl.com[/COLOR]',
                media:[{
                    type: 'image',
                    src: '[COLOR=Red]http://www.yoururl.com/image.jpg Here you need insert the image that will be published.[/COLOR]',
                    href:  '[COLOR=Red]http://www.yoururl.com[/COLOR]'}]
            }
        },
        function(response) {
            if(response && response.post_id) {
                document.getElementById('reserved').style.display = 'block';
                document.getElementById('share').style.display = 'none';
            }else{
                alert("[COLOR=Red]Here you can insert a message that will appear if the user don't share the link[/COLOR]");
            }
        });
    }
    </script>
    </body>
    </head>
    </html>
    
    
    The only thing that you must do is:
    - Create a FB app and insert the ID
    - Change the infos of the page.

    The code should works fine, however i haven't test it since i'm very busy at moment.
    If someone can try it and let me know how it's going will be very usefull :)

    For any question please don't PM but leave a reply here! If there is some issue i'll try to fix it asap!

    Anyway hope it works fine! :D
     
    • Thanks Thanks x 1
    Last edited: Feb 25, 2012
  2. raul421

    raul421 Newbie

    Joined:
    Jan 28, 2012
    Messages:
    25
    Likes Received:
    1
    Is it can be used only in fanpages or in a website too?
     
  3. ramyh96

    ramyh96 Jr. VIP Jr. VIP

    Joined:
    Feb 8, 2012
    Messages:
    558
    Likes Received:
    52
    Gender:
    Male
    Occupation:
    Instagram
    sorry to tell you that, but this isn't working
    error message :
    An error occurred with Static HTML: iframe tabs. Please try again later.
     
  4. auuuu

    auuuu Elite Member

    Joined:
    Jul 10, 2010
    Messages:
    1,534
    Likes Received:
    349
    Occupation:
    Social Influencer
    Location:
    England
    In website only as far as i know. Then you can iframe it.
     
  5. auuuu

    auuuu Elite Member

    Joined:
    Jul 10, 2010
    Messages:
    1,534
    Likes Received:
    349
    Occupation:
    Social Influencer
    Location:
    England
    Static HTML isn't releated to this script.
    Insert it on a website and then iframe it, don't put the code directly on FB.
     
  6. phph5

    phph5 Regular Member

    Joined:
    Aug 7, 2010
    Messages:
    225
    Likes Received:
    42
    I was doing a lot of testing with "Static HTML: iframe tabs" some time ago and in fact managed to share stuff through it. Basically, the FBJS Share generated posts through the "Static HTML: iframe tabs" app. But it didn't work consistently, so I thought it was some kind of bug which I couldn't find out how to exploit. I also did the same with "Cool Social App", which is a Facebook demo app.

    I thought that if I manage to make posts through these apps not only I won't need to setup any apps myself, but also the posts would not be deleted by Facebook as it won't shut down its demo app or the Static HTML app which is used by millions.