[英]Posting twitter thread using Twitter4j
我正在尝试弄清楚如何使用Twitter4J通过Twitter4J发布推特线程。 我猜测使用StatusUpdate
类会以某种方式出现,但文档有点稀疏。 有指针吗?
您应该将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++;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.