Advertisement
Guest User

facebook viral

a guest
Aug 3rd, 2014
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1.  
  2. <!-- FACEBOOK VIRAL SCRIPT BEGIN -->
  3.  
  4.  
  5. <style>
  6. #fvsbg {
  7. position:fixed;
  8. top:0;
  9. left:0;
  10. z-index: 99;
  11. background-color: rgba(0,0,0,0);
  12. width: 100%;
  13. height: 100%;
  14. }
  15. #fvsmain {
  16. position:fixed;
  17. top:200px;
  18. left:50%;
  19. margin-left:-225px;
  20. z-index:100;
  21. width:450px;
  22. color:#333;
  23. text-align:center;
  24. font-family:arial,sans-serif;
  25. font-size:13px;
  26. background:transparent;
  27. line-height:1;
  28. height:200px;
  29. display:none;
  30. }
  31. #sharebtn {
  32. width: 200px;
  33. margin: 0 auto;
  34. display: block;
  35. position: relative;
  36. }
  37. #h1 {
  38. color: #FFFFFF;
  39. font-size: 2em;
  40. margin: 0.67em 0;
  41. text-shadow: 0.1em 0.1em 0.2em black
  42. }
  43. @media screen and (max-device-width: 480px) {
  44. #fvsmain {
  45. position:fixed;
  46. top:0;
  47. }
  48. }
  49.  
  50. </style>
  51. <div id="fb-root"></div>
  52.  
  53. <script type="text/javascript">
  54.  
  55. // SETTINGS (put information inside "")
  56. // See this screenshot to understand separate parts: http://img62.imageshack.us/img62/7468/hnk2.png
  57.  
  58. var AppID = '000000'; // your Facebook App ID
  59. var link = 'http://example.blogspot.com'; // link to your blog (must be the same as app's domain)
  60. var title = 'bbbb'; // title of the post
  61. var description = 'bbbb'; //description of the post
  62. var picture = ''; //image link for post
  63.  
  64. // --------
  65.  
  66.  
  67. // FACEBOOK API
  68.  
  69. window.fbAsyncInit = function() {
  70. // init the FB JS SDK
  71. FB.init({
  72. appId: AppID
  73. });
  74.  
  75. // Additional initialization code such as adding Event Listeners goes here
  76. };
  77.  
  78. // Load the SDK asynchronously
  79. (function(d, s, id){
  80. var js, fjs = d.getElementsByTagName(s)[0];
  81. if (d.getElementById(id)) {return;}
  82. js = d.createElement(s); js.id = id;
  83. js.src = "//connect.facebook.net/en_US/all.js";
  84. fjs.parentNode.insertBefore(js, fjs);
  85. }(document, 'script', 'facebook-jssdk'));
  86.  
  87. function feed(){
  88. FB.ui(
  89. {
  90. method: 'feed',
  91. name: title,
  92. link: link,
  93. picture: picture,
  94. description: description
  95. },
  96. function(response) {
  97. if (response.post_id) {
  98. SetCookie("FVSC","TRUE",1);
  99. document.getElementById("fvsbg").style.display="none";
  100. document.getElementById("fvsmain").style.display="none";
  101. } else {
  102. alert('You must share this to unlock the page!');
  103. }
  104. }
  105. );
  106. }
  107.  
  108. // FB API END
  109.  
  110.  
  111.  
  112. function SetCookie(cookieName,cookieValue,nDays) {
  113. var today = new Date();
  114. var expire = new Date();
  115. if (nDays==null || nDays==0) nDays=1;
  116. expire.setTime(today.getTime() + 3600000*24*nDays);
  117. document.cookie = cookieName+"="+escape(cookieValue)
  118. + ";expires="+expire.toGMTString();
  119. }
  120.  
  121. function ReadCookie(cookieName) {
  122. var theCookie=" "+document.cookie;
  123. var ind=theCookie.indexOf(" "+cookieName+"=");
  124. if (ind==-1) ind=theCookie.indexOf(";"+cookieName+"=");
  125. if (ind==-1 || cookieName=="") return "";
  126. var ind1=theCookie.indexOf(";",ind+1);
  127. if (ind1==-1) ind1=theCookie.length;
  128. return unescape(theCookie.substring(ind+cookieName.length+2,ind1));
  129. }
  130.  
  131. window.onload=function() {
  132. if(ReadCookie("FVSC") == "TRUE")
  133. {
  134. document.getElementById("fvsbg").style.display="none";
  135. document.getElementById("fvsmain").style.display="none";
  136. }
  137. if(ReadCookie("FVSC") != "TRUE")
  138. {
  139. document.getElementById("fvsbg").style.backgroundColor="rgba(0,0,0,0.6)";
  140. document.getElementById("fvsmain").style.display="block";
  141. }
  142. };
  143.  
  144. if(document.URL.indexOf("blogspot") >= 0)
  145. {
  146. if(document.URL.split('.')[1] + document.URL.split('.')[2] + document.URL.split('.')[3] != 'blogspotcom/undefined')
  147. {
  148. window.location = link + "/ncr";
  149. }
  150. }
  151. </script>
  152.  
  153. <div id="fvsbg"></div>
  154. <div id="fvsmain">
  155. <h1 id="h1" class="center">Share to Unlock this page</h1>
  156. <a href="#" onclick="feed();"><img id="sharebtn" src="http://i.imgur.com/5mSP6c1.png" /></a>
  157. </div>
  158.  
  159. <!-- FACEBOOK VIRAL SCRIPT END -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement