MATLAB: Unable to tweet from Matlab

twitter

Currently trying to tweet from matlab. I have set up an app in twitter and then used the API keys respectively as below. But when I log into my twitter account, I am unable to see the tweet posted.
Kindly help me.
consumerkey = 'xxxx';
consumersecret = 'yyyy';
accesstoken = 'zzzz';
accesstokensecret = 'tttt';
c=twitter(consumerkey,consumersecret,accesstoken,accesstokensecret);
c.StatusCode
baseurl = 'https://api.twitter.com/1.1/account/settings.json';
tweetString = "Hello";
d = postdata(c,baseurl,'status',tweetString)
Output: –
ResponseMessage with properties:
StatusLine: 'HTTP/1.1 200 OK'
StatusCode: OK
Header: [1×25 matlab.net.http.HeaderField]
Body: [1×1 matlab.net.http.MessageBody]
Completed: 0
Edited by Guillaume: Replaced keys/secrets that allows anybody to impersonate you on twitter.

Best Answer

According to this example, the base url to post tweet is
baseurl = 'https://api.twitter.com/1.1/statuses/update.json';
not the one you're using.
I don't have the datafeed toolbox (nor a twitter account) to test.