Php 从facebook视频中提取720px缩略图
我需要从视频中提取缩略图到facebook 我应该通过json来做,事实是我无法将图像提取到720px 我这样做了,但我什么也没得到,没有错误或任何东西Php 从facebook视频中提取720px缩略图,php,json,facebook,facebook-graph-api,Php,Json,Facebook,Facebook Graph Api,我需要从视频中提取缩略图到facebook 我应该通过json来做,事实是我无法将图像提取到720px 我这样做了,但我什么也没得到,没有错误或任何东西 <?php /* 10152765849330530 https://www.facebook.com/video.php?v=10152765849330530&set=vb.48166220529&type=2&theater */ $id = "10152765849330530"; $xml
<?php
/*
10152765849330530
https://www.facebook.com/video.php?v=10152765849330530&set=vb.48166220529&type=2&theater
*/
$id = "10152765849330530";
$xml = @file_get_contents('https://graph.facebook.com/' . $id);
$result = @json_decode($xml);
//var_dump($result);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
$result = $result->format->picture;
echo $result;
?>
想法
链接将被提取:
刚刚尝试使用您的代码,现在可以工作了-
<?php
/*
10152765849330530
https://www.facebook.com/video.php?v=10152765849330530&set=vb.48166220529&type=2&theater
*/
$id = "10152765849330530";
$xml = file_get_contents('http://graph.facebook.com/' . $id);
$result = json_decode($xml);
echo "<pre>";
echo $result->format[0]->picture;
?>
获取720px大小的图片-
echo$xml代码>试试这个,输出是什么?这个:然后试试打印($result)代码>就在json_解码之后。输出是什么?这个:我不知道。但该视频是公开的,而且是一个非常著名的意大利节目。获取130x130图像而不是720px您想获取130px大小或720px大小?已解决:echo$result->format[3]->picture;编辑:我现在看到你的更新,tnx:D
<?php
/*
10152765849330530
https://www.facebook.com/video.php?v=10152765849330530&set=vb.48166220529&type=2&theater
*/
$id = "10152765849330530";
$xml = file_get_contents('http://graph.facebook.com/' . $id);
$result = json_decode($xml);
echo "<pre>";
echo $result->format[3]->picture;
?>