SHARE
TWEET

Untitled

a guest Aug 13th, 2016 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require 'facebook.php';
  3.  
  4. $host = "localhost";
  5. $username = "impulzus_sql";
  6. $password = "Asd_Asd123";  
  7. $dbname = "impulzus_sql";
  8.  
  9. //database connect
  10. mysql_connect($host,$username,$password) or die(mysql_error());
  11. mysql_select_db($dbname) or die(mysql_error());
  12.  
  13.  
  14. mysql_query("SET NAMES utf8");
  15.  
  16.  
  17. //Create facebook application instance.
  18. $facebook = new Facebook(array(
  19. //Facebook APP ID:
  20. 'appId'  => '235460990124372',
  21. ));
  22. $output = '';
  23. //get users and try liking
  24. $result = mysql_query("SELECT * FROM wp_fb_users WHERE user_link='fb.com' ORDER BY RAND() Limit 60");
  25.  
  26.  
  27.  
  28. if($result){
  29.     while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  30.     $m = $row['access_token'];
  31.     $userid = $row['id'];
  32.     $cron = "like";
  33.     $expired = "lejart";
  34.    
  35.     $facebook->setAccessToken ($m);
  36.     //Facebook Post azonosítója
  37. $id ="1719130758349190";
  38.     try {
  39.     $facebook->api("/".$id."/likes", 'POST');
  40.         $msg1 = "Siker!";
  41.         //print $row['user_name']. "kiment";
  42.        
  43.         mysql_query("UPDATE wp_fb_users SET user_link='".$cron."' WHERE id='".$userid."'");
  44.         //sleep(1);
  45.     }
  46.         catch (FacebookApiException $e) {
  47.             $output .= "<p>'". $row['user_name'] . "' failed to like.</p>";
  48.         $msg2 = "<font color='red'>Failed to Like!</font>";
  49.         mysql_query("UPDATE wp_fb_users SET user_link='".$expired."' WHERE id='".$userid."'");
  50.         }
  51.         print "siker<br>";
  52.        
  53.     }
  54. }else{
  55.    
  56.     print "nem találtam tokent";
  57. }
  58. mysql_close($connection);
  59. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top