【问题标题】:spring social Twitter update status not giving id_str春季社交 Twitter 更新状态未提供 id_str
【发布时间】:2015-01-19 08:23:37
【问题描述】:

我正在为我的项目使用 Spring Social twitter。我正在尝试让推文成为最爱,因为我需要 id_str = "your tweet id"。但问题是当我使用 spring social 更新状态时,它返回 id = "" 但不是 id_str。我看到它正在返回Tweet 类。在那个类中没有像 id_str 这样的字段。所以我的问题是如何获得 id_str

注意:id 和 id_str 是一样的。它返回不同的值。

【问题讨论】:

    标签: java spring twitter spring-social-twitter


    【解决方案1】:

    idid_str 应该相同。 id_str 存在是因为某些平台难以处理非常大的整数。

    您应该使用getId(),然后将 long 转换为字符串。

    【讨论】:

    • 谢谢特伦斯。我之前已经检查过了。即使您查看 Twitter 控制台 dev.twitter.com/rest/tools/console 。在此尝试更新状态时,它将同时给出不同的 id 和 id_str。
    【解决方案2】:

    id_str 在 extraData 映射中可用:

    twitterProfile.getExtraData().get("id_str")

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-07
      • 2016-05-04
      • 1970-01-01
      • 2014-09-21
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多