Twitter 取图像&;来自状态/用户\时间线API的推文的外部URL
我希望提取Tweet中存在的外部URL的值。加上该URL生成的缩略图 示例推文: TwitterTwitter 取图像&;来自状态/用户\时间线API的推文的外部URL,twitter,Twitter,我希望提取Tweet中存在的外部URL的值。加上该URL生成的缩略图 示例推文: Twitterstatus/user\u timelineAPI的输出- { "created_at": "Wed Jul 17 15:00:01 +0000 2019", "id": 1151506848387870720, "id_str": "1151506848387870720", "full_text": "عروض #صيف_هواوي على أجهزة التا
status/user\u timeline
API的输出-
{
"created_at": "Wed Jul 17 15:00:01 +0000 2019",
"id": 1151506848387870720,
"id_str": "1151506848387870720",
"full_text": "عروض #صيف_هواوي على أجهزة التابلت والميت بوك المختلفة \nالعرض ساري الى 21 يوليو",
"truncated": false,
"display_text_range": [
0,
78
],
"entities": {
"hashtags": [
{
"text": "صيف_هواوي",
"indices": [
5,
15
]
}
],
"symbols": [],
"user_mentions": [],
"urls": []
},
"source": "<a href=\"https:\/\/ads-api.twitter.com\" rel=\"nofollow\">Twitter Ads Composer<\/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": 281376243,
"id_str": "281376243"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 3,
"favorited": false,
"retweeted": false,
"lang": "ar"
},
为什么反应是随机的?它确实会返回比尔·盖茨推特的URL,但不会返回我问题前面提到的那个
我如何让Twitter同时显示外部URL和缩略图
我的最后一个API调用-
您提供的两个示例中的第一个示例是由Twitter广告平台发布的,因此附带的卡片不是推特的一部分。没有办法通过API获得这些信息。在第二种情况下,URL是Tweet文本的一部分,因此它也是URL实体对象的一部分。ahh。。有道理。对于第二条推文,有没有办法提取推文生成的缩略图?我知道我可以访问链接并从META中提取twitter:image值,但我不想走这条路。我希望在API中看到一个解决方案。API中不支持这个。
{
"created_at": "Mon Jul 15 03:18:27 +0000 2019",
"id": 1150605518291001345,
"id_str": "1150605518291001345",
"full_text": "I recently wrote about how people with tech skills can find fascinating problems to work on in global health and development. I was excited to come across this @techreview article about African machine learning researchers who are already doing just that. https:\/\/t.co\/3e1d2QvvH4",
"truncated": false,
"display_text_range": [
0,
279
],
"entities": {
"hashtags": [],
"symbols": [],
"user_mentions": [
{
"screen_name": "techreview",
"name": "MIT Technology Review",
"id": 15808647,
"id_str": "15808647",
"indices": [
160,
171
]
}
],
"urls": [
{
"url": "https:\/\/t.co\/3e1d2QvvH4",
"expanded_url": "https:\/\/b-gat.es\/2xMsbdh",
"display_url": "b-gat.es\/2xMsbdh",
"indices": [
256,
279
]
}
]
},
"source": "<a href=\"https:\/\/www.sprinklr.com\" rel=\"nofollow\">Sprinklr<\/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": 50393960,
"id_str": "50393960"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 1320,
"favorite_count": 6719,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"lang": "en"
},