諸事情により、PHPでサムネイルを取得して表示するプログラムを書いているので、 ついでにYouTubeとニコニコ動画のサムネイルを取得するプログラムをまとめておきます。 (以前書いたエントリの再まとめおよび更新版です) 以前書いたエントリ YouTube API を使ってみる。 ニコニコ動画APIを使ってサムネイルを取得する。 YouTubeの場合 APIの仕様 http://gdata.youtube.com/feeds/api/videos/video ID サムネイルの取得 $xml->children('http://search.yahoo.com/mrss/')->group->thumbnail[0]->attributes()->url サンプルコード function getYouTubeThumbnailById($movieId) { $xml = @simplexm
![【PHP】 APIを使って動画のサムネイルを取得するまとめ 【2009年版】](https://cdn-ak-scissors.b.st-hatena.com/image/square/94437dc568d4c0562753d7031575e122374dd7f4/height=288;version=1;width=512/https%3A%2F%2Fnplll.com%2Fwp-content%2Fthemes%2Funderstrap-child%2Fimg%2Fog-image.jpg)