I\'m using Twitter4J to send tweets automatically. Basically what I want to do is:
If a user tweets my account, I\'ll reply with \"Hello hello!\" for example. I know
Don't use rest api here. Use streaming api (Follow stream). Follow your own handle.
public void onStatus(Status status) {
System.out.println("onStatus @" + status.getUser().getScreenName() + " - "+ status.getText());
System.out.println(status.getInReplyToUserId());
Twitter tf = new TwitterFactory().getInstance();
StatusUpdate st = new StatusUpdate("hello");
st.inReplyToStatusId(status.getId());
try {
tf.updateStatus(st);
} catch (TwitterException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}