Code covered by the BSD License  

Highlights from
Update twitter status

4.75

4.8 | 4 ratings Rate this file 11 Downloads (last 30 days) File Size: 4.99 KB File ID: #20290

Update twitter status

by

 

13 Jun 2008 (Updated )

Update your Twitter® status from MATLAB®

| Watch this File

File Information
Description

Using a MATLAB function update your status in Twitter.

Acknowledgements

This file inspired Flickr Api With O Auth Based User Authentication and Twitty.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
10 May 2013 Orlando

Do I use the same "Application Name" and "Website" that you used in the M-file example? I don't have an application name to put there. Sorry. New at this.

05 Mar 2013 Tobe freeman

Dear Navan Ruthramoorthy
Having troubles with an error message (below). Can you help?

I corrected/added the authentification details in twitter4j.properties but this didn't help.

Error using twit>throwError (line 136)
Authentication details were not correct.
Error in twit (line 120)
throwError(ME.message);

30 Apr 2012 Navan Ruthramoorthy

Hi Michael,

Did you run javaaddpath as mentioned in my previous comment when you start MATLAB? You may need to add this to your startup file.

23 Apr 2012 Michael Antaran

Navan-

It's back! This worked for me at one time.

??? Undefined variable "Base64" or class "Base64.encodeBase64".

Error in ==> twit>doHMAC_SHA1 at 160
signStr = java.lang.String(Base64.encodeBase64(mac.doFinal(bytes)));

Error in ==> twit at 99
oauth_signature = doHMAC_SHA1(signStr, signKey);

Can you help me again.

thanks

19 Oct 2011 Shien Kwun Leong

Very useful! Thank you very much.

17 Dec 2010 Navan Ruthramoorthy

Michael and Menachem,
Sorry I did not check the code in R2007b after the update. Apache commons package is not available in R2007b. To make it work in R2007b you need to do the following.

1. Download the Apache commons codec binaries from http://commons.apache.org/codec/download_codec.cgi.
2. After you extract the binaries add the jar file to the java path using
javaaddpath('<pathtofile>/commons-codec-1.4.jar'). Replace <pathtofile> with the directory where you extracted the files.
3. In twit.m replace the line:114 which currently is
114: outputStream.write(java.lang.String(msgEncodedStrforPost).getBytes());

with the following two lines.

msgEncodedStrforPostString = java.lang.String(msgEncodedStrforPost);
outputStream.write(msgEncodedStrforPostString.getBytes());

After this it should work. Let me know if this helps.

From R2008a the Apache commans libraries are available and the code works without any changes.

16 Dec 2010 Menachem

Hello, I just downloaded your program and got the same error as michael. I dont know if I am using your program correctly. I entered my twitter info and msg as strings.

thanks

??? Undefined variable "Base64" or class "Base64.encodeBase64".

Error in ==> twit>doHMAC_SHA1 at 160
signStr = java.lang.String(Base64.encodeBase64(mac.doFinal(bytes)));

Error in ==> twit at 99
oauth_signature = doHMAC_SHA1(signStr, signKey);

16 Dec 2010 Michael Antaran

Navan-
I've had a difficult time with the twitpref function.

I recieve an error referncing the base64... Here it is:

??? Undefined variable "Base64" or class "Base64.encodeBase64".

Error in ==> twit>doHMAC_SHA1 at 160
signStr = java.lang.String(Base64.encodeBase64(mac.doFinal(bytes)));

Error in ==> twit at 99
oauth_signature = doHMAC_SHA1(signStr, signKey);

I understnad what it says but do not know how to fix it. I am using 2007b (32 and 64bit).
Please help.

14 Dec 2010 Matthew Simoneau

Implementing OAuth in MATLAB. Very nice!

09 Dec 2010 Sounay Phothisane  
08 Dec 2010 Navan Ruthramoorthy

I have updated the script with OAuth support. The user needs to do a one time registration of the function as an application at twitter.com to get OAuth keys. The details are provided as part of help in the script. It is easy to use the function once you obtain the keys.

21 Nov 2010 Michael Antaran

I look forward to the update.

20 Oct 2010 Navan Ruthramoorthy

Hi Matt, I am working on an update for the authentication method.

20 Oct 2010 Matt Easton

This worked really well until Twitter changed their posting system. It now gives a response saying basic authentication is not accepted.

04 Jun 2009 Michael Katz

Fun submission. You should check out http://www.mathworks.com/matlabcentral/fileexchange/6590 to get a password field for the user info GUI.

Updates
09 Nov 2010

Updated script to make it work with OAuth.

03 Dec 2010

Updated script to support OAuth.

17 Dec 2010

Changed MATLAB release needed.

Contact us