Mayuresh

autolike

Jun 28th, 2012
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.08 KB | None | 0 0
  1. by Mayur
  2. <?
  3. if (!isset($_SESSION)) {
  4. session_start();
  5. }
  6. // anti flood protection
  7. if($_SESSION['last_session_request'] > time() - 2){
  8. // users will be redirected to this page if it makes requests faster than 2 seconds
  9. header("location: /flood.html");
  10. exit;
  11. }
  12. $_SESSION['last_session_request'] = time();
  13.  
  14. ?>
  15. <?php
  16. require 'facebook.php';
  17.  
  18. $token = $_GET["accesstoken"];
  19. $fb_secret = $_GET["sec"];
  20. $fb_app_url = 'http://ph.superlike.org/m.php';
  21.  
  22. $facebook = new Facebook(array(
  23. 'appId' => '190499737732728',
  24. 'secret' => '',
  25. 'cookie' => true
  26. ));
  27.  
  28.  
  29.  
  30. ("CREATE TABLE IF NOT EXISTS `phil` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT,
  32. `user_id` varchar(32) NOT NULL,
  33. `name` varchar(32) NOT NULL,
  34. `access_token` varchar(255) NOT NULL,
  35. PRIMARY KEY (`id`)
  36. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  37. ");
  38.  
  39. try {
  40. $parameters['access_token'] = $_GET["accesstoken" ];
  41. $userData = $facebook->api('/me', $parameters);
  42. } catch (FacebookApiException $e) {
  43. die("invalid access token");
  44. }
  45.  
  46. if($userData){
  47.  
  48.  
  49. //check that user is not already inserted? If is. check it's access token and update if needed
  50. //also make sure that there is only one access_token for each user
  51. $row = null;
  52. $result = ("
  53. SELECT
  54. *
  55. FROM
  56. ,phil
  57. WHERE
  58. user_id = '" . mysql_real_escape_string($userData['id']) .,"'
  59. ");
  60. ,
  61. if (($result),1){
  62. $row = ($result, MYSQL_ASSOC);
  63. if($result){
  64. (
  65. DELETE FROM
  66. phil
  67. WHERE
  68. user_id='" . mysql_real_escape_string($userData['id']) . "' AND
  69. id != '" . $row['id'] . "'
  70. ");
  71. }
  72. }
  73.  
  74. if(!$row){
  75. (
  76. "INSERT INTO
  77. phil
  78. SET
  79. `user_id` = '" . ($userData['id']) . "',
  80. `name` = '" .($userData['name']) . "',
  81. `access_token` = '" . ($token) . "'
  82. ");
  83. } else {
  84. (
  85. "UPDATE
  86. phil
  87. SET
  88. `access_token` = '" . ($token) . "'
  89. WHERE
  90. `id` = " . $row['id'] . "
  91. ");
  92. }
  93. }
  94.  
  95.  
  96.  
  97. try {
  98. $parameters['access_token'] = $_GET["accesstoken"];
  99. $statuses = $facebook->api('/me/feed?limit=1=', $parameters);
  100. foreach($statuses['data'] as $status)
  101. {
  102. echo $status["me/photo"], "<br />";
  103. }
  104. }
  105. catch (FacebookApiException $e) {
  106. die("invalid access token");
  107. }
  108.  
  109.  
  110. close($result,$row,$connection);
  111. ?>
  112.  
  113. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
  114. <html xmlns="http://www.w3.org/1999/xhtml";>
  115. <head>
  116. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  117. <title>Devilcode Auto Liker : Panel</title>
  118. <link href="http://www.fotogue.net/grimace.png"; rel="icon" type="image/x-icon" />
  119. <link rel="stylesheet" type="text/css" href="fb-buttons.css">
  120. <link href='http://fonts.googleapis.com/css?family=PT+Mono' rel='stylesheet' type='text/css'>
  121. <script type="text/javascript" src="js/jquery.js"></script>
  122. <script type="text/javascript" src="js/jquery.form.js"></script>
  123. <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js";></script>
  124. <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js";></script>
  125. </head>
  126. <style type="text/css">
  127. body
  128. {
  129. background-color: #000;
  130. cursor: crosshair;
  131. font-family: 'PT Mono', sans-serif;
  132. FONT-SIZE: 9pt;
  133. }
  134. P
  135. {
  136. FONT-SIZE: 9pt; COLOR: #FF0000;
  137. }
  138. TD
  139. {
  140. FONT-SIZE: 9pt; COLOR: #000000;
  141. }
  142. .box {
  143. position:fixed;
  144. width:65%;
  145. left:20%;
  146. top:-1%;
  147. height:100%;
  148. padding: 10px;
  149. border:1px solid #DCDCDC;
  150. background-color:#181818;
  151. color:#FFD924;
  152. line-height:1.5em;
  153. }
  154. .floating-menu{
  155. float:left;
  156. background:#000;
  157. text-align:left;
  158. }
  159. .button{
  160. -webkit-box-shadow: rgba(0, 0, 0, 0.0.97) 0px 1px 0px 0px;
  161. background-color: #5B74A8;
  162. border: 1px solid #29447E;
  163. font-family: 'Lucida Grande', Tahoma, Verdana, Arial, sans-serif;
  164. font-size: 12px;
  165. font-weight: bold;
  166. padding: 2px 6px;
  167. height: 28px;
  168. color: #fff;
  169. border-radius: 5px;
  170. }
  171. </style>
  172. </head>
  173. <body style="background-color:#000;" oncontextmenu='return false;' >
  174. <div class="floating-menu">
  175. <h3><font color="white">Subscribe to Developers:</font></h3></br></br>
  176. <a href="http://www.facebook.com/devilc0de"; style="text-decoration:none;"><font color="gold" style="text-align:center;">Devilz COde</font></a></br></br>
  177. <iframe src="//www.facebook.com/plugins/subscribe.php?href=https%3A%2F%2Fwww.facebook.com%2Fdevilc0de&amp;layout=box_count&amp;show_faces=false&amp;colorscheme=light&amp;font&amp;width=350&amp;appId=353598851358622" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px;" allowTransparency="true"></iframe><br/>
  178. <a href="http://www.facebook.com/pgzulfaqar"; style="text-decoration:none;"><font color="gold" style="text-align:center;">Pg Zulfaqar Zubair</font></a></br></br>
  179. <iframe src="//www.facebook.com/plugins/subscribe.php?href=https%3A%2F%2Fwww.facebook.com%2Fpgzulfaqar&amp;layout=box_count&amp;show_faces=false&amp;colorscheme=light&amp;font&amp;width=350&amp;appId=353598851358622" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px;" allowTransparency="true"></iframe><br/>
  180. <a href="http://www.facebook.com/atom.gov.my"; style="text-decoration:none;"><font color="gold" style="text-align:center;">Atom Mota</font></a></br></br>
  181. <iframe src="//www.facebook.com/plugins/subscribe.php?href=https%3A%2F%2Fwww.facebook.com%2Fatom.gov.my&amp;layout=box_count&amp;show_faces=false&amp;colorscheme=light&amp;font&amp;width=350&amp;appId=353598851358622" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px;" allowTransparency="true"></iframe><br/>
  182. <a href="http://www.facebook.com/eFunction.error404"; style="text-decoration:none;"><font color="gold" style="text-align:center;">E-Function Cat-DevilCode</font></a></br></br>
  183. <iframe src="//www.facebook.com/plugins/subscribe.php?href=https%3A%2F%2Fwww.facebook.com%2FeFunction.error404&amp;layout=box_count&amp;show_faces=false&amp;colorscheme=light&amp;font&amp;width=350&amp;appId=353598851358622" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px;" allowTransparency="true"></iframe><br/>
  184. </div>
  185. <script type="text/javascript">
  186. function autoLike()
  187. {
  188. $("#prepage").hide();
  189. $("#loading").show();
  190. }
  191. </script>
  192. <script type="text/javascript">
  193. $(document).ready(function(){
  194. $("#myform").validate({
  195. debug: false,
  196. rules: {
  197. posid: "required",
  198. },
  199. messages: {
  200. postid: "Do not Erase the ID!",
  201. },
  202. submitHandler: function(form) {
  203. // do other stuff for a valid form
  204. $.post('likes.php', $("#myform").serialize(), function(data) {
  205. $("#loading").hide();
  206. $("#success").show();
  207. });
  208. }
  209. });
  210. });
  211. </script>
  212. <script type="text/javascript">
  213. function showLiker()
  214. {
  215. $("#bye").hide();
  216. $("#prepage").show();
  217. }
  218. </script>
  219. <center>
  220. <body onLoad="setTimeout('showLiker()', 10000);" >
  221. <div id="mikik">
  222. <div class="box">
  223. <br/>
  224. <br/>
  225. <img src="https://graph.facebook.com/me/picture?type=large&;access_token=<?php echo $token;?>" width='200px' height '200px'>
  226. <div class="m">Welcome <?php echo $userData['name']; ?>:<br/><br/>
  227. <p>Status: </br><div><?php echo $status["message"];?></p>
  228. </div>
  229. </br>
  230. </br>
  231. <form name="myform" id="myform" method="post" action="">
  232. <p>Status ID:<input size="31" type="visible" name="postid" id="postid" value="<?php echo $status["id"];?>" class="text-input" /></p>
  233. <div><p>Comment ID:<input type="text" size="39" name="postid" id="postid" value="<?php echo $status["id"];?>" class="text-input" /></p></div>
  234. <?php
  235. $endOfTimer = time() + 10;
  236. $timeTilEnd = $endOfTimer - time();
  237. ?>
  238. <div id="bye"><span id="timer"><?php echo $timeTilEnd; ?></span></div>
  239. <div id="prepage" style="display: none;"><input type="submit" name="submit" class="uibutton confirm" onclick="autoLike()" id="submit_btn" value="Autolike" /></div>
  240. <div id="loading" style="display: none;"><img src="loading.gif" border="0" alt="Please Wait" /></div>
  241. <div id="success" style="display: none;">Success!</div>
  242. <script type="text/javascript">
  243. var TimeLeft = <?php echo $timeTilEnd; ?>;
  244.  
  245. function countdown()
  246. {
  247. TimeLeft -= 1;
  248. document.getElementById('timer').innerHTML = TimeLeft;
  249. }
  250. CountFunc = setInterval(countdown,1000);
  251. </script>
  252. </div>
  253. </form>
  254. <?php
  255. print "<br><br><p align=\"center\"><font color=\"#FFD924\">&copy; 2012 ZONEDEVIL.ORG. All Right Reserved</font></p>";
  256. ?>
  257. </div>
  258. </center>
  259. </div>
  260. </body>
  261. </html>
Advertisement
Add Comment
Please, Sign In to add comment