twitter4j.Twitter.getSentDirectMessages()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中twitter4j.Twitter.getSentDirectMessages()方法的一些代码示例,展示了Twitter.getSentDirectMessages()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Twitter.getSentDirectMessages()方法的具体详情如下:
包路径:twitter4j.Twitter
类名称:Twitter
方法名:getSentDirectMessages

Twitter.getSentDirectMessages介绍

[英]Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent
[中]返回验证用户发送的直接消息的列表。
此方法调用http://twitter.com/direct_messages/sent

代码示例

代码示例来源:origin: net.homeip.yusuke/twitter4j

/**
 * Returns a list of the direct messages sent by the authenticating user.
 * <br>This method calls http://twitter.com/direct_messages/sent
 *
 * @param sinceId returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
 * @return List
 * @throws TwitterException when Twitter service or network is unavailable
 * @deprecated Use getSentDirectMessages(Paging paging) instead
 * @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-direct_messages%C2%A0sent">Twitter API Wiki / Twitter REST API Method: direct_messages sent</a>
 */
public List<DirectMessage> getSentDirectMessages(int sinceId) throws
    TwitterException {
  return getSentDirectMessages(new Paging((long)sinceId));
}

代码示例来源:origin: net.homeip.yusuke/twitter4j

/**
 * Returns a list of the direct messages sent by the authenticating user.
 * <br>This method calls http://twitter.com/direct_messages/sent
 *
 * @param sinceId returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
 * @param page Retrieves the 20 next most recent direct messages.
 * @return List
 * @throws TwitterException when Twitter service or network is unavailable
 * @since Twitter4J 2.0.0
 * @deprecated Use getSentDirectMessages(Paging paging) instead
 * @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-direct_messages%C2%A0sent">Twitter API Wiki / Twitter REST API Method: direct_messages sent</a>
 */
public List<DirectMessage> getSentDirectMessages(int page
    , int sinceId) throws TwitterException {
  return getSentDirectMessages(new Paging(page, (long)sinceId));
}

代码示例来源:origin: org.twitter4j/twitter4j-async

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    ResponseList<DirectMessage> directMessages = twitter.getSentDirectMessages();
    for (TwitterListener listener : listeners) {
      try {
        listener.gotSentDirectMessages(directMessages);
      } catch (Exception e) {
        logger.warn("Exception at getSentDirectMessages", e);
      }
    }
  }
});

代码示例来源:origin: org.twitter4j/twitter4j-async

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    ResponseList<DirectMessage> directMessages = twitter.getSentDirectMessages(paging);
    for (TwitterListener listener : listeners) {
      try {
        listener.gotSentDirectMessages(directMessages);
      } catch (Exception e) {
        logger.warn("Exception at getSentDirectMessages", e);
      }
    }
  }
});

相关文章