我想使用graph获取大型facebook视频缩略图。下面的代码获取小缩略图
https://graph.facebook.com/VIDEO_ID/picture
此代码将返回Ex:
https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-prn1/632393_10151574602254838_10151574598089838_34404_282_t.jpg
如果我用"n"代替"t",我将得到大图像
https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-prn1/632393_10151574602254838_10151574598089838_34404_282_n.jpg
但是,我如何使用facebook图形或使用php 将"t"替换为"n"
提前谢谢。
您可以使用此php代码,它对我有效。
<?php
$video_id = "10153231379946729";
$xml = file_get_contents('http://graph.facebook.com/' . $video_id);
$result = json_decode($xml);
$small = $result->format[0]->picture;
$medium = $result->format[1]->picture;
//fetch the 720px sized picture
$large = $result->format[3]->picture;
?>
<img src="<?php echo $medium;?>">