Java 使用Twitter4j发布twitter线程
我想知道如何使用Twitter4J发布Twitter4J的tweet线程。我猜它会以某种方式使用Java 使用Twitter4j发布twitter线程,java,twitter,twitter4j,Java,Twitter,Twitter4j,我想知道如何使用Twitter4J发布Twitter4J的tweet线程。我猜它会以某种方式使用StatusUpdate类,但是文档有点稀疏。有任何提示吗?您应该将inReplyToStatusId设置为第一条tweet之后的每条tweet的最新发布状态id。inReplyToStatusId的默认值为-1 例如: long inReplyToStatusId = -1 int counter = 0 int threadLimit = 5 while (counter < thread
StatusUpdate
类,但是文档有点稀疏。有任何提示吗?您应该将inReplyToStatusId设置为第一条tweet之后的每条tweet的最新发布状态id。inReplyToStatusId的默认值为-1
例如:
long inReplyToStatusId = -1
int counter = 0
int threadLimit = 5
while (counter < threadLimit){
StatusUpdate statusUpdate = new StatusUpdate(Integer.toString(counter));
statusUpdate.setInReplyToStatusId(inReplyToStatusId);
Status updatedStatus = twitter.updateStatus(statusUpdate);
inReplyToStatusId = updatedStatus.getId();
counter++;
}
long inReplyToStatusId=-1
整数计数器=0
int threadLimit=5
while(计数器
对于第一条tweet之后的每条tweet,您应该将inReplyToStatusId设置为最新发布的状态id。inReplyToStatusId的默认值为-1
例如:
long inReplyToStatusId = -1
int counter = 0
int threadLimit = 5
while (counter < threadLimit){
StatusUpdate statusUpdate = new StatusUpdate(Integer.toString(counter));
statusUpdate.setInReplyToStatusId(inReplyToStatusId);
Status updatedStatus = twitter.updateStatus(statusUpdate);
inReplyToStatusId = updatedStatus.getId();
counter++;
}
long inReplyToStatusId=-1
整数计数器=0
int threadLimit=5
while(计数器
只是一个快速打字更正:lastPostedStatusId
应该是inReplyToStatusId
只是一个快速打字更正:lastPostedStatusId
应该是inReplyToStatusId