Cerca nel blog

mercoledì 20 marzo 2013

Come aumentare rapidamente i follower, i like e i +1 del vostro sito: il social pagamento!

Like (di Adam Fagen - Flickr)
Articolo originale: How to Accept Social Payments on your Website

Avete collegato il vostro sito ad un account Twitter, ad una pagina Facebook e/o ad una pagina Google+ e volete aumentare rapidamente il numero di follower, di like e di +1? Semplicissimo basta usare il social pagamento!

In che consiste? Invece di fare pagare il vostro contenuto con del denaro, fatelo pagare con un click su i vari gadget. Il semplice codice javascript proposto nel post e qui replicato intercetta i click ai vari social gadget e aggiunge al link l'indirizzo di un pdf da fare scaricare all'utente (o il link ad un'altra pagina). Eccovi il codice, con l'avvertenza che basta guardare nel sorgente della pagina web per risalire al link e bypassare il tutto, ma considerando che non c'è denaro difficilmente qualcuno lo farà...


<html xmlns:fb="http://ogp.me/ns/fb#">
    <head>
        <title>Pay with a Tweet, Facebook Like or Google +1</title>
        /*  Original Social Payments by Digital Inspiration (2013) */
        /*  You are free to use, modify or republish this code  */
        /*  Tradotto da Cut 'n' Post!  */
    </head>
    <body>
    <div id="fb-root"></div>
    <script type="text/javascript">

        function labnol() {
          // Il file da fare scaricare all'utente dopo il click sul gadget
          var url = "http://www.labnol.org/";  
          url = "<a href='" + url + "'>Click here</a> to download the file.";
          document.getElementById("restricted").innerHTML = url;
        }

        window.fbAsyncInit = function() {
          FB.init({ status : true, cookie : true, xfbml  : true });
          FB.Event.subscribe('edge.create', function(response) { labnol(); });
        };

        (function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));

        window.twttr = (function (d,s,id) {
          var t, js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
          js.src="//platform.twitter.com/widgets.js"; 
          fjs.parentNode.insertBefore(js, fjs);
          return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
        }(document, "script", "twitter-wjs"));

        twttr.ready(function (twttr) {
          twttr.events.bind('tweet', function(event) {
            labnol();
          });
        });

        (function() {
          var po = document.createElement('script'); 
          po.type = 'text/javascript'; po.async = true;
          po.src = 'https://apis.google.com/js/plusone.js';
          var s = document.getElementsByTagName('script')[0]; 
          s.parentNode.insertBefore(po, s);
        })();
    </script>

     <div id="restricted">

      // Add the default text of the tweet and your Twitter handle    
      <a href="https://twitter.com/share"                                       
          data-text="Digital Inspiration is my favorite how-to blog http://labnol.org" 
          data-via="labnol" class="twitter-share-button" data-lang="en"></a>

      // The URL of the page that visitor need to +1 on Google Plus
      <g:plusone size="medium" callback="labnol"
          href="http://www.labnol.org/"></g:plusone>

      // The full URL of your Facebook Page goes here
      <fb:like href="http://www.facebook.com/digital.inspiration" send="false" 
          layout="button_count" width="220" show_faces="false"></fb:like>

     </div>
    </body>
  </html>

Nessun commento:

Posta un commento

Non sono consentiti commenti anonimi; qualunque commento che reputerò maleducato, di spam o che non tiene alto il livello della discussione verrà cancellato. A mio insindacabile giudizio.

Related Posts Plugin for WordPress, Blogger...