I would like to post from php to twitter using api 1.1. I have followed this post:
how to post tweet using twitter 1.1 api and twitteroauth
and it's step by step link solution
Simplest PHP example for retrieving user_timeline with Twitter API version 1.1
but nothing happens. Should I change the REQUEST SETTINGS in the OAUTH TOOL tab to
request url: https://api.twitter.com/1.1/statuses/update.json
request type: post
and if so how do you do this? There seems to be no way to update this from the current
get
here is the code for the post:
require_once('TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'oauth_access_token' => "",
'oauth_access_token_secret' => "",
'consumer_key' => "",
'consumer_secret' => ""
);
$url = 'https://api.twitter.com/1.1/statuses/update.json';
$requestMethod = 'POST';
$postfields = array('status' => 'Hi This is a post' );
$twitter = new TwitterAPIExchange($settings);
echo $twitter->buildOauth($url, $requestMethod)
->setPostfields($postfields)
->performRequest();
This is as suggested in the link. I have of course added the relevant codes -tokens and secrets.
Any help appreciated.