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.StatusCodebaseurl = '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