简体   繁体   English

推特api上的推文图像其余响应

[英]Tweet image on twitter api rest response

This the example response of https://api.twitter.com/1.1/statuses/show.json?id=210462857140252672 on Twitter api endpoint which get a tweet information. 这是在Twitter api端点https://api.twitter.com/1.1/statuses/show.json?id=210462857140252672的示例响应,该响应得到了推文信息。

{
  "coordinates": null,
  "favorited": false,
  "truncated": false,
  "created_at": "Wed Jun 06 20:07:10 +0000 2012",
  "id_str": "210462857140252672",
  "entities": {
    "urls": [
      {
        "expanded_url": "https://dev.twitter.com/terms/display-guidelines",
        "url": "https://url",
        "indices": [
          76,
          97
        ],
        "display_url": "dev.twitter.com/terms/display-\u2026"
      }
    ],
    "hashtags": [
      {
        "text": "Twitterbird",
        "indices": [
          19,
          31
        ]
      }
    ],
    "user_mentions": [

    ]
  },
  "in_reply_to_user_id_str": null,
  "contributors": [
    14927800
  ],
  "text": "Along with our new #Twitterbird, we've also updated our Display Guidelines: https://url",
  "retweet_count": 66,
  "in_reply_to_status_id_str": null,
  "id": 210462857140252672,
  "geo": null,
  "retweeted": true,
  "possibly_sensitive": false,
  "in_reply_to_user_id": null,
  "place": null,
  "user": {
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_sidebar_border_color": "C0DEED",
    "profile_background_tile": false,
    "name": "Twitter API",
    "profile_image_url": "http://a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
    "created_at": "Wed May 23 06:01:13 +0000 2007",
    "location": "San Francisco, CA",
    "follow_request_sent": false,
    "profile_link_color": "0084B4",
    "is_translator": false,
    "id_str": "6253282",
    "entities": {
      "url": {
        "urls": [
          {
            "expanded_url": null,
            "url": "http://dev.twitter.com",
            "indices": [
              0,
              22
            ]
          }
        ]
      },
      "description": {
        "urls": [

        ]
      }
    },
    "default_profile": true,
    "contributors_enabled": true,
    "favourites_count": 24,
    "url": "http://dev.twitter.com",
    "profile_image_url_https": "https://si0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
    "utc_offset": -28800,
    "id": 6253282,
    "profile_use_background_image": true,
    "listed_count": 10774,
    "profile_text_color": "333333",
    "lang": "en",
    "followers_count": 1212963,
    "protected": false,
    "notifications": null,
    "profile_background_image_url_https": "http://si0.twimg.com/images/themes/theme1/bg.png",
    "profile_background_color": "C0DEED",
    "verified": true,
    "geo_enabled": true,
    "time_zone": "Pacific Time (US & Canada)",
    "description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
    "default_profile_image": false,
    "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
    "statuses_count": 3333,
    "friends_count": 31,
    "following": true,
    "show_all_inline_media": false,
    "screen_name": "twitterapi"
  },
  "in_reply_to_screen_name": null,
  "source": "web",
  "in_reply_to_status_id": null
}

The question is ,what is the field which cointains the tweet image(if exists)??Because there is no a filed like 'tweet_image' or something like that 问题是,包含tweet图像的字段是什么(如果存在)?因为没有诸如“ tweet_image”之类的文件

This Tweet does not have any images attached to it. 该推文没有附加任何图像。 The body of a Tweet that has an image will have an extended_entities tree containing the media entity or entities. 具有图像的Tweet的主体将具有一个extended_entities树,其中包含一个或多个media实体。 You can read more about this in the Twitter documentation . 您可以在Twitter文档中阅读有关此内容的更多信息。 Here's an example of a recent Tweet of mine with an image attached. 这是我最近发布的推文示例,其中附有图片。

{
  "created_at": "Mon Jul 11 21:50:25 +0000 2016",
  "id": 752621088723566592,
  "id_str": "752621088723566592",
  "text": "Darned Pidgey is after my beer. (link)",
  "truncated": false,
  "entities": {
    "hashtags": [

    ],
    "symbols": [

    ],
    "user_mentions": [

    ],
    "urls": [
      {
        "url": "(link)",
        "expanded_url": "http://pipr.co/29zNseX",
        "display_url": "pipr.co/29zNseX",
        "indices": [
          32,
          55
        ]
      }
    ],
    "media": [
      {
        "id": 752621086345465856,
        "id_str": "752621086345465856",
        "indices": [
          56,
          79
        ],
        "media_url": "http://pbs.twimg.com/media/CnHY4_YXEAAYm9J.jpg",
        "media_url_https": "https://pbs.twimg.com/media/CnHY4_YXEAAYm9J.jpg",
        "url": "(link)",
        "display_url": "pic.twitter.com/S1pIUQisNW",
        "expanded_url": "http://twitter.com/andypiper/status/752621088723566592/photo/1",
        "type": "photo",
        "sizes": {
          "medium": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          },
          "thumb": {
            "w": 150,
            "h": 150,
            "resize": "crop"
          },
          "large": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          },
          "small": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          }
        }
      }
    ]
  },
  "extended_entities": {
    "media": [
      {
        "id": 752621086345465856,
        "id_str": "752621086345465856",
        "indices": [
          56,
          79
        ],
        "media_url": "http://pbs.twimg.com/media/CnHY4_YXEAAYm9J.jpg",
        "media_url_https": "https://pbs.twimg.com/media/CnHY4_YXEAAYm9J.jpg",
        "url": "(link)",
        "display_url": "pic.twitter.com/S1pIUQisNW",
        "expanded_url": "http://twitter.com/andypiper/status/752621088723566592/photo/1",
        "type": "photo",
        "sizes": {
          "medium": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          },
          "thumb": {
            "w": 150,
            "h": 150,
            "resize": "crop"
          },
          "large": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          },
          "small": {
            "w": 582,
            "h": 582,
            "resize": "fit"
          }
        }
      }
    ]
  },
  "source": "<a href=\"http://ifttt.com\" rel=\"nofollow\">IFTTT</a>",
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 786491,
    "id_str": "786491",
    "name": "Pipes",
    "screen_name": "andypiper",
    "location": "Kingston upon Thames, London",
    "description": "I'm on the @TwitterDev team, supporting and listening to developers working on the Twitter platform. Code, community, and respect. #HeForShe",
    "url": "(link)",
    "entities": {
      "url": {
        "urls": [
          {
            "url": "(link)",
            "expanded_url": "http://about.me/andypiper",
            "display_url": "about.me/andypiper",
            "indices": [
              0,
              23
            ]
          }
        ]
      },
      "description": {
        "urls": [

        ]
      }
    },
    "protected": false,
    "followers_count": 13542,
    "friends_count": 3898,
    "listed_count": 781,
    "created_at": "Wed Feb 21 15:14:48 +0000 2007",
    "favourites_count": 65599,
    "utc_offset": 3600,
    "time_zone": "London",
    "geo_enabled": true,
    "verified": false,
    "statuses_count": 89932,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "is_translation_enabled": false,
    "profile_background_color": "ACDEEE",
    "profile_background_image_url": "http://abs.twimg.com/images/themes/theme18/bg.gif",
    "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme18/bg.gif",
    "profile_background_tile": false,
    "profile_image_url": "http://pbs.twimg.com/profile_images/753281917944893440/63g61GqD_normal.jpg",
    "profile_image_url_https": "https://pbs.twimg.com/profile_images/753281917944893440/63g61GqD_normal.jpg",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/786491/1468424285",
    "profile_link_color": "6EA8E6",
    "profile_sidebar_border_color": "FFFFFF",
    "profile_sidebar_fill_color": "F6F6F6",
    "profile_text_color": "333333",
    "profile_use_background_image": true,
    "has_extended_profile": true,
    "default_profile": false,
    "default_profile_image": false,
    "following": false,
    "follow_request_sent": false,
    "notifications": false
  },
  "geo": null,
  "coordinates": null,
  "place": null,
  "contributors": null,
  "is_quote_status": false,
  "retweet_count": 1,
  "favorite_count": 11,
  "favorited": false,
  "retweeted": false,
  "possibly_sensitive": false,
  "possibly_sensitive_appealable": false,
  "lang": "en"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:使用Fabric,Twitter REST API和Retrofit为tweet添加图像 - Android: adding image to tweet using Fabric, Twitter REST API and Retrofit Android:尝试使用Fabric和Twitter REST API推媒体时出现“ 400错误请求”错误 - Android: “400 bad request” error when trying to tweet with media using Fabric and Twitter REST API 使用Twitter API android显示最后和早期的推文 - Show last and early tweet with Twitter API android 使用Fabric在Twitter上撰写或共享图像 - Tweet Compose OR Sharing Image On Twitter Using Fabric 使用消息和使用Twitter身份验证在Twitter上发布图像的简易技术? - Which the Easy technique to tweet the Image on Twitter with the Message and Using Twitter Auth? Android - Fabric.io Twitter REST API个人资料图片/图片 - Android - Fabric.io Twitter REST API profile image / picture 如何在Android应用程序中使用twitter api仅发送推文 - how to use twitter api in android application for send tweet only Android Studio - 从 twitter 获取推文图片 - Fabric - Android Studio - Get tweet image from twitter - Fabric 如何在不使用Twitter的TweetPic的情况下上传图像和鸣叫消息? - How to upload Image and tweet the message without using TweetPic for twitter? 如何使用 Twitter4j api 回复推文? - How to use Twitter4j api to reply on a tweet?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM