Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何嵌入推特推文。。如何从tweets URL捕获图像并显示实际图像?_Php_Twitter_Embedly - Fatal编程技术网

Php 如何嵌入推特推文。。如何从tweets URL捕获图像并显示实际图像?

Php 如何嵌入推特推文。。如何从tweets URL捕获图像并显示实际图像?,php,twitter,embedly,Php,Twitter,Embedly,我想知道我可以用什么样的方法直接嵌入twitter推文中包含的视频或图片。。。例如下面是奥巴马的推特 President Obama: "Right now, we have a real chance to reduce gun violence in America." http://t.co/tmCoUsPyyB #TimeToAct 以htttp://开头的链接可能是图片。。我怎样才能真正编程,使推特与来自URL的图像一起直接显示?我知道PHP,我以前也使用过twitter API,但

我想知道我可以用什么样的方法直接嵌入twitter推文中包含的视频或图片。。。例如下面是奥巴马的推特

President Obama: "Right now, we have a real chance to reduce gun violence in America." http://t.co/tmCoUsPyyB #TimeToAct

以htttp://开头的链接可能是图片。。我怎样才能真正编程,使推特与来自URL的图像一起直接显示?我知道PHP,我以前也使用过twitter API,但我不知道如何轻松实现这一点。任何帮助都将不胜感激

第一步是提取文本块的URL,还有一个问题向您指出如何解决此问题:

然后,您可以使用Embeddely或类似的服务来提取与该url关联的元数据。以下是嵌入将返回的元数据示例:

html
属性是您希望在页面上呈现的内容

我们还有一个PHP库,您也可以使用

希望有帮助