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.
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);
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.
Comment only