- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Twitter API 从给定的推文中导入视频。但是,当我使用 statuses/show
时端点,它不会像图像那样返回视频的任何扩展实体,而是返回一个链接到某个视频容器的 url 实体,该容器嵌入了一个视频播放器,其中包含指向视频的模糊链接。
下面是一个例子:
我正在尝试将推文导入 https://twitter.com/NHL/status/633987786018717696
使用 Twitter API 的 statuses/show
端点和推文ID,我得到这个回应:
{
"created_at": "Wed Aug 19 13:04:01 +0000 2015",
"id": 633987786018717700,
"id_str": "633987786018717696",
"text": "The offseason has us missing all of our fans, even the wacky ones... especially the wacky ones. #IsItOctoberYet?\nhttps://t.co/v4UGDQpa61",
"source": "<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>",
"truncated": false,
"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": 50004938,
"id_str": "50004938",
"name": "NHL",
"screen_name": "NHL",
"location": "30 cities across U.S. & Canada",
"description": "The official source of everything you need and want to know from the National Hockey League. Read before tweeting us: http://t.co/JlyVXSpqMn",
"url": "http://t.co/VI8RlwuVr9",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co/VI8RlwuVr9",
"expanded_url": "http://www.NHL.com",
"display_url": "NHL.com",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
{
"url": "http://t.co/JlyVXSpqMn",
"expanded_url": "http://nhl.com/socialmediapolicy",
"display_url": "nhl.com/socialmediapol…",
"indices": [
118,
140
]
}
]
}
},
"protected": false,
"followers_count": 4130811,
"friends_count": 2646,
"listed_count": 18479,
"created_at": "Tue Jun 23 15:24:18 +0000 2009",
"favourites_count": 909,
"utc_offset": -14400,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": true,
"statuses_count": 87436,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": true,
"profile_background_color": "000000",
"profile_background_image_url": "http://pbs.twimg.com/profile_background_images/378800000139631457/fd-xWa9G.jpeg",
"profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/378800000139631457/fd-xWa9G.jpeg",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/534776558238437376/yxrm83O7_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/534776558238437376/yxrm83O7_normal.jpeg",
"profile_banner_url": "https://pbs.twimg.com/profile_banners/50004938/1435502670",
"profile_link_color": "040CDE",
"profile_sidebar_border_color": "FFFFFF",
"profile_sidebar_fill_color": "2E2E2E",
"profile_text_color": "0F5A80",
"profile_use_background_image": true,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 865,
"favorite_count": 1342,
"entities": {
"hashtags": [
{
"text": "IsItOctoberYet",
"indices": [
96,
111
]
}
],
"symbols": [],
"user_mentions": [],
"urls": [
{
"url": "https://t.co/v4UGDQpa61",
"expanded_url": "https://amp.twimg.com/v/2a0210d1-4d39-4665-a749-ea34f8efef08",
"display_url": "amp.twimg.com/v/2a0210d1-4d3…",
"indices": [
113,
136
]
}
]
},
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"possibly_sensitive_appealable": false,
"lang": "en"
}
https://amp.twimg.com/amplify-web-player/prod/source.html?vmap_url=https%3A%2F%2Famp.twimg.com%2Fprod%2Fmultibr_v_1%2Fvmap%2F2015%2F08%2F20%2F13%2F609fc2af-1d06-4894-80be-1c231f97557a%2Fa69baa90-58de-4d1d-b2dc-2c3ef1ab9b35.vmap&duration=91.958&image_src=https%3A%2F%2Famp.twimg.com%2Fprod%2Fdefault%2F2015%2F08%2F20%2F13%2Fe8f0b317-ba48-4cec-bf2c-da4598e2b46b_poster-67227.jpg&content_id=609fc2af-1d06-4894-80be-1c231f97557a&page=amplify_card
最佳答案
Twitter API 现在已更改,视频存储在 extended_entities 对象中。根据比特率,可能有多个来源。这是检索具有最高比特率的方法:
var bitrate = 0;
var hq_video_url;
for (var j=0; j<tweet.extended_entities.media[0].video_info.variants.length; j++) {
if (tweet.extended_entities.media[0].video_info.variants[j].bitrate) {
if (tweet.extended_entities.media[0].video_info.variants[j].bitrate > bitrate) {
bitrate = tweet.extended_entities.media[0].video_info.variants[j].bitrate;
hq_video_url = tweet.extended_entities.media[0].video_info.variants[j].url;
}
}
}
关于api - 使用 Twitter API 从推文中获取视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32145166/
当我推/拉存储库时,是否可以详细输出到底发生了什么?目前,我有一个大型存储库,正在将其推送到服务器,大约 15 分钟后。或者这样,它给了我一个错误,但没有告诉我它在这 15 分钟内做了什么。 最佳答案
我不知道我的方法是否有意义,但是,我需要实现如下图的布局: 现在,我只写一个 并用其中的一列表示每个区域,例如 . 没有黄色区域,这工作正常: green red blue
当我查看许多 CSS 网格系统和框架时,它们通常具有标准的列和行设置以及百分比宽度。例如这样的事情: 标准网格列: .col-10 { width: 83.33333%; width: cal
我想使用 git 子模块。 我需要采取的步骤将我的更改推送到我的项目是 add/commit/push from submodule directory add/commit/push from pa
以下为百度站长平台的公告全文: 结合站长对于关键词数据分析的需求,站长平台对流量与关键词工具进行了升级,推出(“关键词影响力”)这一全新概念。关键词影响力算法复杂,涵盖该关键词下百度搜索可以为
我需要一个具有普通按钮和下拉按钮的控件。 例如 类似的控件在 wxRibbonButtonBar 中可用,我无法在简单的 wxPanel 中使用它。 最佳答案 我实现了 SplitButton,它看起
我一直在做一个项目,使用 Bazaar 作为版本控制系统。现在我必须和离岸人员一起工作,而他们只想使用 SVN。 我有什么: 我的 bazaar 分支及其文件和修订版。 一个全新的 subversio
我一直在开发数据流/图表风格的内部 DSP 应用程序(Java 带有 Groovy/Jython/JRuby 的钩子(Hook),通过 OSGi 的插件,大量的 JNI),类似于纯数据和 simuli
我正在尝试使用 THUMB 指令创建一个阶乘方法,我基本上做到了。 我只有一个关于 PUSH/POP 操作码的问题:如果我使用 push 将 r0 的值存储在堆栈中(所以 push {r0} ),我可
在尝试 ZeroMQ Push/Pull (他们称之为 Pipeline)套接字类型时,我很难理解这个图案。它被称为“负载均衡器”。 假设单个服务器将任务发送给多个工作人员,推/拉将在所有客户端之间平
有什么方法可以使用 push() 方法找出我的数据何时保存在数据库中?我写了下面的代码,但它多次保存数据...... db.ref('news').push(opts).then(() => {
我有这个问题,每次推或拉时我都必须把它放进去。我认为这是新的。有什么想法吗? 最佳答案 您可能正在使用 https 网址。切换到 ssh 并确保您的 key 设置正确(如果您的密码短语为空),则不必输
为什么当您将一个值压入堆栈时,ESP 寄存器会减少(而不是增加),而当您弹出一个值时,ESP 寄存器会增加(而不是减少)?在这一点上,这对我来说是违反直觉的。 最佳答案 那是因为堆栈是从上到下“增长”
有什么方法可以使用 push() 方法找出我的数据何时保存在数据库中?我写了下面的代码,但它多次保存数据...... db.ref('news').push(opts).then(() => {
我决定编写一个测试代码来查看 pusher - many pullers bundle 是如何工作的,我的怀疑成真了。 拉取器按照连接的顺序接收消息,例如第一个消息由第一个连接的拉取器接收,第二个由第
我在 CSV 文件中存储了一长串日期。我已经成功地使用 d3.js 加载了这个数据集。现在我想向此数据集添加另一列,其中包含列表中每个日期的随机数。 我相信此数据集已作为对象数组加载。所以我正在使用下
我一直在寻找解决方案。不使用 c++11。 for(int a = 1; a < team1.chan; a++) { team1.nums.push_back(ppb.back())
我打算在布局中构建带有滑动 subview 的 UI。 +--------------+ +--------------+ +--------------+ | view1
Title 在小屏幕上,我首先需要标题,然后是文本字段,但在中等以上的屏幕上,我需要相反的方式 - 我已经尝试过推和拉,但它们无法工作 - 有什么想法吗? 最佳答案 根据 Swa
zmq 的某些部分未以可预测的方式运行。 我正在使用 VS2013 和 zmq 3.2.4。为了不在我的 pubsub 框架中“丢失”消息 [旁白:我认为这是一个设计缺陷。我应该能够首先启动我的订阅者
我是一名优秀的程序员,十分优秀!