【问题标题】:How to get twitter profile image from profile id如何从个人资料 ID 获取 Twitter 个人资料图片
【发布时间】:2014-09-15 20:55:48
【问题描述】:

如何从个人资料 ID 中获取最新的 Twitter 个人资料图片。

现在我可以从我保存在我的数据库中的静态 url 获取个人资料图片

href="http://www.twitter.com/{{ tweet.user.screen_name }}"

tweet.user.screen_name 是我将数据保存到 db 时的个人资料图像的路径。

我需要这样的路径:https://twitter/FunctionThatReturnThePathOfActualProfileImage/userid

你有什么想法吗? 谢谢

【问题讨论】:

    标签: scala twitter


    【解决方案1】:

    您正在寻找的 Twitter REST API 方法称为 GET users/show [1]。使用配置文件 ID 的示例请求如下所示:

    https://api.twitter.com/1.1/users/show.json?user_id=795649
    

    JSON 响应有两个键,profile_image_urlprofile_image_url_https,它们应该包含您要查找的信息。请注意,调用此 API 需要通过 OAuth 对您的应用程序进行身份验证。

    [1]https://dev.twitter.com/docs/api/1.1/get/users/show

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-08
      相关资源
      最近更新 更多