Guest User

Untitled

a guest
May 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2. require_once($_SERVER['DOCUMENT_ROOT'].'/twitteroauth.php');
  3. $consumerKey = 'insert consumerkey';
  4.  
  5. $consumerSecret ='insert consumersecret';
  6.  
  7. $oAuthToken ='insert accesstoken';
  8.  
  9. $oAuthSecret ='insert accesstoken secret ';
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. // create a new instance
  18.  
  19. $tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
  20.  
  21.  
  22.  
  23. //send a tweet
  24.  
  25. if($tweet->post('statuses/update', array('status' => 'Api practice with @regularlambda ')))
  26. echo 'Tweet';
  27. else
  28. echo 'Fail++';
  29.  
  30.  
  31. ?>
Add Comment
Please, Sign In to add comment