processing oAuth Twitter 403
in
Contributed Library Questions
•
3 years ago
- import processing.net.*;
import processing.serial.*;
import cc.arduino.*;
Serial port;
String msg = "Entry Lock opened at " +hour()+":"+minute()+":"+second()+"!";
//copy and paste these from your application in dev.twitter.com
void setup() {
String portName = Serial.list()[1];
port = new Serial(this, portName, 9600);
println(Serial.list());
}
void draw() {
while (port.available() > 0) {
String consumer_key = "***"; //i hide it
String consumer_secret = "***";
String oauth_token = "***";
String oauth_token_secret = "***";
Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance (
consumer_key, consumer_secret,
new AccessToken( oauth_token, oauth_token_secret) );
String str1 = port.readString();
String str2 = "ok";
println(str1);
if(str1.equals(str2) == true){
println("Sending Code....");
try {
Status st = twitter.updateStatus(msg);
println("Successfully updated the status to [" + st.getText() + "].");
}
catch (TwitterException e) {
println(e.getStatusCode());
}
}
}
}
i can send a message to my twitter. however,
when i already send one message to twitter, the next time i send again, i get 403.
so i need to stop Processing and run it again to send another post.
that is very inconvenient don't you think? so i would really appreciate if you help me find out
and solve the the problem that's making 403....
please.....
1